Mercurial > hg > freeDiameter
diff extensions/test_app/ta_cli.c @ 127:8ee43cf85a5f
Added User-Name AVP in test_app extension
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Thu, 10 Dec 2009 14:39:55 +0900 |
parents | a66027056162 |
children | 536b1dde8761 |
line wrap: on
line diff
--- a/extensions/test_app/ta_cli.c Thu Dec 10 14:34:31 2009 +0900 +++ b/extensions/test_app/ta_cli.c Thu Dec 10 14:39:55 2009 +0900 @@ -195,6 +195,14 @@ /* Set Origin-Host & Origin-Realm */ CHECK_FCT_DO( fd_msg_add_origin ( req, 0 ), goto out ); + /* Set the User-Name AVP if needed*/ + if (ta_conf->user_name) { + CHECK_FCT_DO( fd_msg_avp_new ( ta_user_name, 0, &avp ), goto out ); + val.os.data = (unsigned char *)(ta_conf->user_name); + val.os.len = strlen(ta_conf->user_name); + CHECK_FCT_DO( fd_msg_avp_setvalue( avp, &val ), goto out ); + CHECK_FCT_DO( fd_msg_avp_add( req, MSG_BRW_LAST_CHILD, avp ), goto out ); + } /* Set the Test-AVP AVP */ {