Mercurial > hg > waaad
annotate extensions/radius_gw/rgw_msg.c @ 379:0d679f66e34a
Updated strings
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 26 May 2009 16:31:07 +0900 |
parents | e86dba02630a |
children | 03b512313cc1 |
rev | line source |
---|---|
348
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
1 /********************************************************************************************************* |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
2 * Software License Agreement (BSD License) * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
3 * Author: Sebastien Decugis <sdecugis@nict.go.jp> * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
4 * * |
371
e86dba02630a
Updated copyright information
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
369
diff
changeset
|
5 * Copyright (c) 2009, WIDE Project and NICT * |
348
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
6 * All rights reserved. * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
7 * * |
7907e7cc0aef
Some stub files for the gateway extension
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 * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
9 * permitted provided that the following conditions are met: * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
10 * * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
11 * * Redistributions of source code must retain the above * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
12 * copyright notice, this list of conditions and the * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
13 * following disclaimer. * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
14 * * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
15 * * Redistributions in binary form must reproduce the above * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
16 * copyright notice, this list of conditions and the * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
17 * following disclaimer in the documentation and/or other * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
18 * materials provided with the distribution. * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
19 * * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
20 * * Neither the name of the WIDE Project or NICT nor the * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
21 * names of its contributors may be used to endorse or * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
22 * promote products derived from this software without * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
23 * specific prior written permission of WIDE Project and * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
24 * NICT. * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
25 * * |
7907e7cc0aef
Some stub files for the gateway extension
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 * |
7907e7cc0aef
Some stub files for the gateway extension
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 * |
7907e7cc0aef
Some stub files for the gateway extension
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 * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * |
7907e7cc0aef
Some stub files for the gateway extension
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 * |
7907e7cc0aef
Some stub files for the gateway extension
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 * |
7907e7cc0aef
Some stub files for the gateway extension
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 * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
34 *********************************************************************************************************/ |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
35 |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
36 /* This file contains all support functions to parse, create, and manipulate RADIUS messages. Other |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
37 modules do not need to "know" the actual representation of RADIUS messages on the network. They only |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
38 receive the logical view as exposed in the radius_gw.h file. */ |
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
39 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
40 #include "radius_gw.h" |
348
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
41 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
42 /* Two functions for dumping */ |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
43 #include "rgw_msg_codes.c" |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
44 #include "rgw_msg_attrtype.c" |
348
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
45 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
46 /* Destroy a message */ |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
47 void rgw_msg_free(struct rgw_radius_msg_meta ** msg) |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
48 { |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
49 if (!msg || !*msg) |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
50 return; |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
51 |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
52 radius_msg_free(&(*msg)->radius); |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
53 free(*msg); |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
54 *msg = NULL; |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
55 } |
348
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
56 |
367
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
57 /* This function creates a rgw_radius_msg_meta structure after parsing a RADIUS buffer */ |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
58 int rgw_msg_parse(unsigned char * buf, size_t len, struct rgw_radius_msg_meta ** msg) |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
59 { |
367
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
60 struct radius_msg * temp_msg = NULL; |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
61 |
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
62 TRACE_ENTRY("%p %g %p", buf, len, msg); |
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
63 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
64 CHECK_PARAMS( buf && len && msg ); |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
65 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
66 *msg = NULL; |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
67 |
367
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
68 /* Parse the RADIUS message */ |
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
69 temp_msg = radius_msg_parse(buf, len); |
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
70 if (temp_msg == NULL) { |
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
71 TRACE_DEBUG(INFO, "Error parsing the RADIUS message, discarding"); |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
72 return EINVAL; |
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
73 } |
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
74 |
367
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
75 /* Now alloc space for the meta-data */ |
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
76 CHECK_MALLOC( *msg = realloc(temp_msg, sizeof(struct rgw_radius_msg_meta)) ); |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
77 |
367
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
78 /* Clear memory after the parsed data */ |
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
79 memset( &(*msg)->radius + 1, 0, sizeof(struct rgw_radius_msg_meta) - sizeof(struct radius_msg) ); |
e25e6117e6a1
Fixed problem of calling static function from a shared library
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
365
diff
changeset
|
80 |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
81 return 0; |
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
82 } |
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
83 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
84 /* Check if the message has a valid authenticator, and update the meta-data accordingly */ |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
85 int rgw_msg_auth_check(struct rgw_radius_msg_meta * msg, struct rgw_client * cli, uint8_t * req_auth) |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
86 { |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
87 unsigned char * key; |
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
88 size_t keylen; |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
89 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
90 TRACE_ENTRY("%p %p %p", msg, cli, req_auth); |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
91 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
92 CHECK_PARAMS(msg && cli); |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
93 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
94 CHECK_FCT(rgw_clients_getkey(cli, &key, &keylen)); |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
95 |
365
0146c60af026
Moved to the hostap implementation of RADIUS processing (copied radius.* and md5.* files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
363
diff
changeset
|
96 msg->valid_mac = ! radius_msg_verify_msg_auth( &msg->radius, key, keylen, req_auth ); |
360
2206c7f2945a
Added md5 code to check authenticator
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
356
diff
changeset
|
97 |
356
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
98 return 0; |
555dc5a58aef
Added server code for radius extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
353
diff
changeset
|
99 } |
348
7907e7cc0aef
Some stub files for the gateway extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
100 |
368
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
101 /* Dump a message (inspired from radius_msg_dump) */ |
369
16747d768091
Fix typo in function name
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
368
diff
changeset
|
102 void rgw_msg_dump(struct rgw_radius_msg_meta * msg) |
368
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
103 { |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
104 unsigned char *auth; |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
105 size_t i; |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
106 if (! TRACE_BOOL(FULL) ) |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
107 return; |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
108 |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
109 auth = &(msg->radius.hdr->authenticator[0]); |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
110 |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
111 log_debug("------ RADIUS msg dump -------\n"); |
379 | 112 log_debug(" id : 0x%02hhx, code : %hhd (%s)\n", msg->radius.hdr->identifier, msg->radius.hdr->code, rgw_msg_code_str(msg->radius.hdr->code)); |
368
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
113 log_debug(" auth: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n", |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
114 auth[0], auth[1], auth[2], auth[3], |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
115 auth[4], auth[5], auth[6], auth[7]); |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
116 log_debug(" %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n", |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
117 auth[8], auth[9], auth[10], auth[11], |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
118 auth[12], auth[13], auth[14], auth[15]); |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
119 for (i = 0; i < msg->radius.attr_used; i++) { |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
120 struct radius_attr_hdr *attr = (struct radius_attr_hdr *)(msg->radius.buf + msg->radius.attr_pos[i]); |
379 | 121 log_debug(" - len:%3hhd, type:0x%02hhx (%s)\n", attr->length, attr->type, rgw_msg_attrtype_str(attr->type)); |
368
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
122 /* If we need to dump the value, it's better to call directly radius_msg_dump instead... */ |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
123 } |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
124 log_debug("-----------------------------\n"); |
ccc9905c4525
Cleaned RADIUS message dump format
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
367
diff
changeset
|
125 } |