annotate extensions/test_app/ta_dict.c @ 740:4a9f08d6b6ba

Updated my mail address
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 24 Mar 2011 15:00:18 +0900
parents 8ee43cf85a5f
children d59decafe9c0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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) *
740
4a9f08d6b6ba Updated my mail address
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 127
diff changeset
3 * Author: Sebastien Decugis <sdecugis@freediameter.net> *
93
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;
127
8ee43cf85a5f Added User-Name AVP in test_app extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 120
diff changeset
51 struct dict_object * ta_user_name = NULL;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
52 struct dict_object * ta_res_code = NULL;
93
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
53
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
54 int ta_dict_init(void)
93
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
55 {
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
56 TRACE_DEBUG(FULL, "Initializing the dictionary for test");
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
57
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
58 /* Create the Test Vendor */
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
59 {
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
60 struct dict_vendor_data data;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
61 data.vendor_id = ta_conf->vendor_id;
93
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
62 data.vendor_name = "app_test vendor";
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
63 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
64 }
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
65
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
66 /* Create the Test Application */
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
67 {
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
68 struct dict_application_data data;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
69 data.application_id = ta_conf->appli_id;
93
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
70 data.application_name = "app_test application";
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
71 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
72 }
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
73
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
74 /* Create the Test-Request & Test-Answer commands */
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
75 {
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
76 struct dict_cmd_data data;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
77 data.cmd_code = ta_conf->cmd_id;
93
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
78 data.cmd_name = "Test-Request";
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
79 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
80 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
81 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
82 data.cmd_name = "Test-Answer";
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
83 data.cmd_flag_val = CMD_FLAG_PROXIABLE;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
84 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
85 }
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
86
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
87 /* Create the Test AVP */
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
88 {
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
89 struct dict_avp_data data;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
90 data.avp_code = ta_conf->avp_id;
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
91 data.avp_vendor = ta_conf->vendor_id;
93
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
92 data.avp_name = "Test-AVP";
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
93 data.avp_flag_mask = AVP_FLAG_VENDOR;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
94 data.avp_flag_val = AVP_FLAG_VENDOR;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
95 data.avp_basetype = AVP_TYPE_INTEGER32;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
96 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
97 }
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
98
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
99 /* Now resolve some other useful AVPs */
120
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, "Session-Id", &ta_sess_id, 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-Host", &ta_origin_host, 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, "Origin-Realm", &ta_origin_realm, 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-Host", &ta_dest_host, 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, "Destination-Realm", &ta_dest_realm, ENOENT) );
127
8ee43cf85a5f Added User-Name AVP in test_app extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 120
diff changeset
105 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "User-Name", &ta_user_name, ENOENT) );
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
106 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
107
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
108 /* Create the rules for Test-Request and Test-Answer */
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
109 {
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
110 struct dict_rule_data data;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
111 data.rule_min = 1;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
112 data.rule_max = 1;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
113
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
114 /* Session-Id is in first position */
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
115 data.rule_avp = ta_sess_id;
93
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
116 data.rule_position = RULE_FIXED_HEAD;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
117 data.rule_order = 1;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
118 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
119 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
120
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
121 data.rule_position = RULE_REQUIRED;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
122 /* Test-AVP is mandatory */
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
123 data.rule_avp = ta_avp;
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
124 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
125 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
126
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
127 /* idem for Origin Host and Realm */
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
128 data.rule_avp = ta_origin_host;
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
129 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
130 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
131
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
132 data.rule_avp = ta_origin_realm;
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
133 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
134 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
135
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
136 /* And Result-Code is mandatory for answers only */
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
137 data.rule_avp = ta_res_code;
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
138 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
139
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
140 /* And Destination-Realm for requests only */
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
141 data.rule_avp = ta_dest_realm;
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
142 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
143
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
144 /* And Destination-Host optional for requests only */
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
145 data.rule_position = RULE_OPTIONAL;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
146 data.rule_min = 0;
120
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
147 data.rule_avp = ta_dest_host;
d7acdc46134d Renamed several extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 93
diff changeset
148 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
149
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
150 }
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
151
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
152 return 0;
3910804c84db Ported the app_test application
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
153 }
"Welcome to our mercurial repository"