comparison extensions/app_radgw/radius.c @ 516:1c2f5ee38039

Allow RADIUS Proxies with the app_radgw extension
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 27 Aug 2010 10:59:51 +0900
parents a857024cb48b
children 2c097ed9d0ea
comparison
equal deleted inserted replaced
515:b9167b4de7dc 516:1c2f5ee38039
1 /*********************************************************************************/ 1 /*********************************************************************************/
2 /* freeDiameter author note: 2 /* freeDiameter author note:
3 * The content from this file comes directly from the hostap project. 3 * The content from this file comes directly from the hostap project.
4 * It is redistributed under the terms of the BSD license, as allowed 4 * It is redistributed under the terms of the BSD license, as allowed
5 * by the original copyright reproduced bellow. 5 * by the original copyright reproduced bellow.
6 * In addition to this notice, only the #include directives have been modified. 6 * In addition to this notice, the following changes have been done:
7 * - created the radius_msg_dump_attr_val function
7 */ 8 */
8 #include "rgw_common.h" 9 #include "rgw_common.h"
9 10
10 /* Overwrite printf */ 11 /* Overwrite printf */
11 #define printf(args...) fd_log_debug(args) 12 #define printf(args...) fd_log_debug(args)
215 else 216 else
216 printf("<%02x>", c); 217 printf("<%02x>", c);
217 } 218 }
218 219
219 220
220 static void radius_msg_dump_attr(struct radius_attr_hdr *hdr) 221 void radius_msg_dump_attr_val(struct radius_attr_hdr *hdr)
221 { 222 {
222 struct radius_attr_type *attr; 223 struct radius_attr_type *attr;
223 int i, len; 224 int i, len;
224 unsigned char *pos; 225 unsigned char *pos;
225 226
226 attr = radius_get_attr_type(hdr->type); 227 attr = radius_get_attr_type(hdr->type);
227
228 printf(" Attribute %d (%s) length=%d\n",
229 hdr->type, attr ? attr->name : "?Unknown?", hdr->length);
230 228
231 if (attr == NULL) 229 if (attr == NULL)
232 return; 230 return;
233 231
234 len = hdr->length - sizeof(struct radius_attr_hdr); 232 len = hdr->length - sizeof(struct radius_attr_hdr);
280 break; 278 break;
281 279
282 default: 280 default:
283 break; 281 break;
284 } 282 }
283 }
284
285 static void radius_msg_dump_attr(struct radius_attr_hdr *hdr)
286 {
287 struct radius_attr_type *attr;
288
289 attr = radius_get_attr_type(hdr->type);
290
291 printf(" Attribute %d (%s) length=%d\n",
292 hdr->type, attr ? attr->name : "?Unknown?", hdr->length);
293
294 radius_msg_dump_attr_val(hdr);
285 } 295 }
286 296
287 297
288 void radius_msg_dump(struct radius_msg *msg) 298 void radius_msg_dump(struct radius_msg *msg)
289 { 299 {
"Welcome to our mercurial repository"