Mercurial > hg > freeDiameter
annotate extensions/test_app/ta_dict.c @ 120:d7acdc46134d
Renamed several extensions
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Wed, 09 Dec 2009 17:36:38 +0900 |
parents | extensions/app_test/atst_dict.c@3910804c84db |
children | 8ee43cf85a5f |
rev | line source |
---|---|
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
1 /********************************************************************************************************* |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
2 * Software License Agreement (BSD License) * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
3 * Author: Sebastien Decugis <sdecugis@nict.go.jp> * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
4 * * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
5 * Copyright (c) 2009, WIDE Project and NICT * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
6 * All rights reserved. * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
7 * * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
8 * Redistribution and use of this software in source and binary forms, with or without modification, are * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
9 * permitted provided that the following conditions are met: * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
10 * * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
11 * * Redistributions of source code must retain the above * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
12 * copyright notice, this list of conditions and the * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
13 * following disclaimer. * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
14 * * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
15 * * Redistributions in binary form must reproduce the above * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
16 * copyright notice, this list of conditions and the * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
17 * following disclaimer in the documentation and/or other * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
18 * materials provided with the distribution. * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
19 * * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
20 * * Neither the name of the WIDE Project or NICT nor the * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
21 * names of its contributors may be used to endorse or * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
22 * promote products derived from this software without * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
23 * specific prior written permission of WIDE Project and * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
24 * NICT. * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
25 * * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
32 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
34 *********************************************************************************************************/ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
35 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
36 /* Install the dictionary objects */ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
37 |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
38 #include "test_app.h" |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
39 |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
40 struct dict_object * ta_vendor = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
41 struct dict_object * ta_appli = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
42 struct dict_object * ta_cmd_r = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
43 struct dict_object * ta_cmd_a = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
44 struct dict_object * ta_avp = NULL; |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
45 |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
46 struct dict_object * ta_sess_id = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
47 struct dict_object * ta_origin_host = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
48 struct dict_object * ta_origin_realm = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
49 struct dict_object * ta_dest_host = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
50 struct dict_object * ta_dest_realm = NULL; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
51 struct dict_object * ta_res_code = NULL; |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
52 |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
53 int ta_dict_init(void) |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
54 { |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
55 TRACE_DEBUG(FULL, "Initializing the dictionary for test"); |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
56 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
57 /* Create the Test Vendor */ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
58 { |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
59 struct dict_vendor_data data; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
60 data.vendor_id = ta_conf->vendor_id; |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
61 data.vendor_name = "app_test vendor"; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
62 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_VENDOR, &data, NULL, &ta_vendor)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
63 } |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
64 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
65 /* Create the Test Application */ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
66 { |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
67 struct dict_application_data data; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
68 data.application_id = ta_conf->appli_id; |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
69 data.application_name = "app_test application"; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
70 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_APPLICATION, &data, ta_vendor, &ta_appli)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
71 } |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
72 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
73 /* Create the Test-Request & Test-Answer commands */ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
74 { |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
75 struct dict_cmd_data data; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
76 data.cmd_code = ta_conf->cmd_id; |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
77 data.cmd_name = "Test-Request"; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
78 data.cmd_flag_mask = CMD_FLAG_PROXIABLE | CMD_FLAG_REQUEST; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
79 data.cmd_flag_val = CMD_FLAG_PROXIABLE | CMD_FLAG_REQUEST; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
80 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_COMMAND, &data, ta_appli, &ta_cmd_r)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
81 data.cmd_name = "Test-Answer"; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
82 data.cmd_flag_val = CMD_FLAG_PROXIABLE; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
83 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_COMMAND, &data, ta_appli, &ta_cmd_a)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
84 } |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
85 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
86 /* Create the Test AVP */ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
87 { |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
88 struct dict_avp_data data; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
89 data.avp_code = ta_conf->avp_id; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
90 data.avp_vendor = ta_conf->vendor_id; |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
91 data.avp_name = "Test-AVP"; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
92 data.avp_flag_mask = AVP_FLAG_VENDOR; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
93 data.avp_flag_val = AVP_FLAG_VENDOR; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
94 data.avp_basetype = AVP_TYPE_INTEGER32; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
95 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_AVP, &data, NULL, &ta_avp)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
96 } |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
97 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
98 /* Now resolve some other useful AVPs */ |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
99 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Session-Id", &ta_sess_id, ENOENT) ); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
100 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Origin-Host", &ta_origin_host, ENOENT) ); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
101 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Origin-Realm", &ta_origin_realm, ENOENT) ); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
102 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Destination-Host", &ta_dest_host, ENOENT) ); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
103 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Destination-Realm", &ta_dest_realm, ENOENT) ); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
104 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Result-Code", &ta_res_code, ENOENT) ); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
105 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
106 /* Create the rules for Test-Request and Test-Answer */ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
107 { |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
108 struct dict_rule_data data; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
109 data.rule_min = 1; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
110 data.rule_max = 1; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
111 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
112 /* Session-Id is in first position */ |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
113 data.rule_avp = ta_sess_id; |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
114 data.rule_position = RULE_FIXED_HEAD; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
115 data.rule_order = 1; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
116 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_r, NULL)); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
117 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_a, NULL)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
118 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
119 data.rule_position = RULE_REQUIRED; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
120 /* Test-AVP is mandatory */ |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
121 data.rule_avp = ta_avp; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
122 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_r, NULL)); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
123 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_a, NULL)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
124 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
125 /* idem for Origin Host and Realm */ |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
126 data.rule_avp = ta_origin_host; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
127 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_r, NULL)); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
128 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_a, NULL)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
129 |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
130 data.rule_avp = ta_origin_realm; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
131 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_r, NULL)); |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
132 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_a, NULL)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
133 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
134 /* And Result-Code is mandatory for answers only */ |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
135 data.rule_avp = ta_res_code; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
136 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_a, NULL)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
137 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
138 /* And Destination-Realm for requests only */ |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
139 data.rule_avp = ta_dest_realm; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
140 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_r, NULL)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
141 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
142 /* And Destination-Host optional for requests only */ |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
143 data.rule_position = RULE_OPTIONAL; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
144 data.rule_min = 0; |
120
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
145 data.rule_avp = ta_dest_host; |
d7acdc46134d
Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
93
diff
changeset
|
146 CHECK_FCT(fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &data, ta_cmd_r, NULL)); |
93
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
147 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
148 } |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
149 |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
150 return 0; |
3910804c84db
Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
151 } |