Mercurial > hg > freeDiameter
diff extensions/test_app/ta_dict.c @ 1214:c2fbaf2985f4
New options to test_app extension to generate long Diameter messages
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Tue, 18 Jun 2013 16:27:45 +0800 |
parents | d59decafe9c0 |
children | f937feb72734 |
line wrap: on
line diff
--- a/extensions/test_app/ta_dict.c Tue Jun 18 12:44:30 2013 +0800 +++ b/extensions/test_app/ta_dict.c Tue Jun 18 16:27:45 2013 +0800 @@ -42,6 +42,7 @@ struct dict_object * ta_cmd_r = NULL; struct dict_object * ta_cmd_a = NULL; struct dict_object * ta_avp = NULL; +struct dict_object * ta_avp_long = NULL; struct dict_object * ta_sess_id = NULL; struct dict_object * ta_origin_host = NULL; @@ -96,6 +97,18 @@ CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_AVP, &data, NULL, &ta_avp)); } + /* Create the Test Payload AVP */ + if (ta_conf->long_avp_id) { + struct dict_avp_data data; + data.avp_code = ta_conf->long_avp_id; + data.avp_vendor = ta_conf->vendor_id; + data.avp_name = "Test-Payload-AVP"; + data.avp_flag_mask = AVP_FLAG_VENDOR; + data.avp_flag_val = AVP_FLAG_VENDOR; + data.avp_basetype = AVP_TYPE_OCTETSTRING; + CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_AVP, &data, NULL, &ta_avp_long)); + } + /* Now resolve some other useful AVPs */ CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Session-Id", &ta_sess_id, ENOENT) ); CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Origin-Host", &ta_origin_host, ENOENT) );