Mercurial > hg > freeDiameter
comparison extensions/app_diameap/diameap_server.h @ 438:e7814e24e57b
Corrected compilation warnings on app_diameap
author | Souheil Ben Ayed <souheil@tera.ics.keio.ac.jp> |
---|---|
date | Wed, 28 Jul 2010 15:59:39 +0900 |
parents | 0c6e50a5291d |
children | 70eabd4f8a31 |
comparison
equal
deleted
inserted
replaced
437:c405e93bb2cc | 438:e7814e24e57b |
---|---|
37 | 37 |
38 | 38 |
39 #ifndef DIAMEAP_SERVER_H_ | 39 #ifndef DIAMEAP_SERVER_H_ |
40 #define DIAMEAP_SERVER_H_ | 40 #define DIAMEAP_SERVER_H_ |
41 | 41 |
42 /* handler for DiamEAP server callback */ | |
43 static struct disp_hdl * handle; | |
44 | |
45 /* session handler for DiamEAP sessions state machine */ | |
46 static struct session_handler * diameap_server_reg = NULL; | |
47 | 42 |
48 /* session data structure to store */ | 43 /* session data structure to store */ |
49 struct diameap_sess_data_sm | 44 struct diameap_sess_data_sm |
50 { | 45 { |
51 int invalid_eappackets; /* Number of invalid EAP Packet received*/ | 46 int invalid_eappackets; /* Number of invalid EAP Packet received*/ |
117 int diameap_start_server(void); | 112 int diameap_start_server(void); |
118 | 113 |
119 /* stop server*/ | 114 /* stop server*/ |
120 int diameap_stop_server(void); | 115 int diameap_stop_server(void); |
121 | 116 |
122 /* Initialize DiamEAP state machine variables */ | 117 /* Initialize DiamEAP state machine variables |
123 static int diameap_initialize_diameap_sm( | 118 static int diameap_initialize_diameap_sm( |
124 struct diameap_state_machine * diameap_sm, | 119 struct diameap_state_machine * diameap_sm, |
125 struct diameap_sess_data_sm * diameap_sess_data); | 120 struct diameap_sess_data_sm * diameap_sess_data); |
126 | 121 |
127 /* Initialize interface between the diameap and the eap states machines */ | 122 Initialize interface between the diameap and the eap states machines |
128 static int diameap_initialize_diameap_eap_interface( | 123 static int diameap_initialize_diameap_eap_interface( |
129 struct diameap_eap_interface * eap_i); | 124 struct diameap_eap_interface * eap_i); |
130 | 125 |
131 /* Parse received message */ | 126 Parse received message |
132 static int diameap_parse_avps(struct diameap_state_machine * diameap_sm, | 127 static int diameap_parse_avps(struct diameap_state_machine * diameap_sm, |
133 struct msg * req, struct diameap_eap_interface * eap_i); | 128 struct msg * req, struct diameap_eap_interface * eap_i); |
134 | 129 |
135 /* Add an avp to Failed_AVP AVP for answer message */ | 130 Add an avp to Failed_AVP AVP for answer message |
136 static int diameap_failed_avp(struct diameap_state_machine * diameap_sm, | 131 static int diameap_failed_avp(struct diameap_state_machine * diameap_sm, |
137 struct avp * invalidavp); | 132 struct avp * invalidavp); |
138 | 133 |
139 /* Parse EAP Response */ | 134 Parse EAP Response |
140 static int diameap_parse_eap_resp(struct eap_state_machine * eap_sm, | 135 static int diameap_parse_eap_resp(struct eap_state_machine * eap_sm, |
141 struct eap_packet eappacket); | 136 struct eap_packet eappacket); |
142 | 137 |
143 /* */ | 138 |
144 static int diameap_eappacket_new(struct eap_packet * eapPacket, | 139 static int diameap_eappacket_new(struct eap_packet * eapPacket, |
145 struct avp_hdr * avpdata); | 140 struct avp_hdr * avpdata); |
146 | 141 |
147 /* */ | 142 |
148 static int diameap_sess_data_new( | 143 static int diameap_sess_data_new( |
149 struct diameap_sess_data_sm *diameap_sess_data, | 144 struct diameap_sess_data_sm *diameap_sess_data, |
150 struct diameap_state_machine *diameap_sm); | 145 struct diameap_state_machine *diameap_sm); |
151 | 146 |
152 /* */ | 147 |
153 static int diameap_unlink_attributes_lists( | 148 static int diameap_unlink_attributes_lists( |
154 struct diameap_state_machine * diameap_sm); | 149 struct diameap_state_machine * diameap_sm); |
155 | 150 |
156 /**/ | 151 |
157 static int diameap_answer_avp_attributes( | 152 static int diameap_answer_avp_attributes( |
158 struct diameap_state_machine * diameap_sm); | 153 struct diameap_state_machine * diameap_sm); |
159 | 154 |
160 /**/ | 155 |
161 static int diameap_answer_authorization_attributes( | 156 static int diameap_answer_authorization_attributes( |
162 struct diameap_state_machine * diameap_sm); | 157 struct diameap_state_machine * diameap_sm); |
163 | 158 |
164 static void free_attrib(struct auth_attribute * auth_attrib); | 159 static void free_attrib(struct auth_attribute * auth_attrib); |
165 static void free_avp_attrib(struct avp_attribute * avp_attrib); | 160 static void free_avp_attrib(struct avp_attribute * avp_attrib); |
166 static void free_ans_attrib(struct avp_attribute * ans_attrib); | 161 static void free_ans_attrib(struct avp_attribute * ans_attrib); |
167 | 162 |
168 /* */ | 163 |
169 static int diameap_get_avp_attribute(struct fd_list * avp_attributes, | 164 static int diameap_get_avp_attribute(struct fd_list * avp_attributes, |
170 char * attribute, struct avp_attribute ** avp_attrib, int unlink, | 165 char * attribute, struct avp_attribute ** avp_attrib, int unlink, |
171 int *ret); | 166 int *ret); |
172 | 167 |
173 /* */ | 168 |
174 static int diameap_get_auth_attribute(struct fd_list * auth_attributes, | 169 static int diameap_get_auth_attribute(struct fd_list * auth_attributes, |
175 char * attribute, struct auth_attribute ** auth_attrib, int unlink, | 170 char * attribute, struct auth_attribute ** auth_attrib, int unlink, |
176 int *ret); | 171 int *ret); |
177 | 172 |
178 /**/ | 173 |
179 static int diameap_get_ans_attribute(struct fd_list * ans_attributes, | 174 static int diameap_get_ans_attribute(struct fd_list * ans_attributes, |
180 char * attribute, struct avp_attribute ** ans_attrib, int unlink, | 175 char * attribute, struct avp_attribute ** ans_attrib, int unlink, |
181 int *ret); | 176 int *ret); |
182 | 177 |
183 /* */ | 178 |
184 static int diameap_policy_decision(struct diameap_state_machine * diameap_sm, | 179 static int diameap_policy_decision(struct diameap_state_machine * diameap_sm, |
185 struct diameap_eap_interface eap_i); | 180 struct diameap_eap_interface eap_i); |
186 | 181 |
187 /* */ | 182 |
188 static int diameap_add_avps(struct diameap_state_machine * diameap_sm, | 183 static int diameap_add_avps(struct diameap_state_machine * diameap_sm, |
189 struct msg * ans, struct msg * req); | 184 struct msg * ans, struct msg * req); |
190 | 185 |
191 /* */ | 186 |
192 static int diameap_add_user_sessions_avps( | 187 static int diameap_add_user_sessions_avps( |
193 struct diameap_state_machine * diameap_sm, struct msg * ans); | 188 struct diameap_state_machine * diameap_sm, struct msg * ans); |
194 | 189 |
195 /* */ | 190 |
196 static int diameap_add_result_code(struct diameap_state_machine * diameap_sm, | 191 static int diameap_add_result_code(struct diameap_state_machine * diameap_sm, |
197 struct msg * ans, struct session * sess); | 192 struct msg * ans, struct session * sess); |
198 | 193 |
199 /* */ | 194 |
200 static int diameap_add_eap_payload(struct diameap_state_machine * diameap_sm, | 195 static int diameap_add_eap_payload(struct diameap_state_machine * diameap_sm, |
201 struct msg * ans, struct diameap_eap_interface eap_i); | 196 struct msg * ans, struct diameap_eap_interface eap_i); |
202 | 197 |
203 /* */ | 198 |
204 static int diameap_add_authorization_avps(struct diameap_state_machine * diameap_sm, | 199 static int diameap_add_authorization_avps(struct diameap_state_machine * diameap_sm, |
205 struct msg * ans); | 200 struct msg * ans); |
206 | 201 |
207 /* */ | 202 |
208 static int diameap_send(struct msg ** rmsg); | 203 static int diameap_send(struct msg ** rmsg); |
209 | 204 |
210 /* */ | 205 |
211 static int diameap_add_eap_success_avps( | 206 static int diameap_add_eap_success_avps( |
212 struct diameap_state_machine * diameap_sm, struct msg * ans, | 207 struct diameap_state_machine * diameap_sm, struct msg * ans, |
213 struct diameap_eap_interface eap_i); | 208 struct diameap_eap_interface eap_i); |
214 | 209 |
215 /* */ | 210 |
216 void diameap_cli_sess_cleanup(void * arg, char * sid); | 211 void diameap_cli_sess_cleanup(void * arg, char * sid); |
217 | 212 |
218 /* */ | 213 |
219 static void diameap_free(struct diameap_state_machine * diameap_sm); | 214 static void diameap_free(struct diameap_state_machine * diameap_sm); |
220 | 215 |
221 /* */ | 216 |
222 static void diameap_sess_data_free( | 217 static void diameap_sess_data_free( |
223 struct diameap_sess_data_sm * diameap_sess_data); | 218 struct diameap_sess_data_sm * diameap_sess_data); |
224 | 219 |
225 /* */ | 220 |
226 static int diameap_add_accounting_eap_auth_method( | 221 static int diameap_add_accounting_eap_auth_method( |
227 struct diameap_state_machine * diameap_sm, struct msg * ans); | 222 struct diameap_state_machine * diameap_sm, struct msg * ans); |
228 | 223 |
229 /* */ | 224 |
230 static int diameap_add_eap_reissued_payload(struct msg * ans,struct msg * req); | 225 static int diameap_add_eap_reissued_payload(struct msg * ans,struct msg * req);*/ |
231 #endif /* DIAMEAP_SERVER_H_ */ | 226 #endif /* DIAMEAP_SERVER_H_ */ |