2 * Copyright (C) 2000 Alfredo Andres Omella. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
14 * 3. The names of the authors may not be used to endorse or promote
15 * products derived from this software without specific prior
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23 /* \summary: Radius protocol printer */
26 * Radius printer routines as specified on:
29 * "Remote Authentication Dial In User Service (RADIUS)"
35 * "RADIUS Accounting Modifications for Tunnel Protocol Support"
38 * "RADIUS Attributes for Tunnel Protocol Support"
47 * "IEEE 802.1X Remote Authentication Dial In User Service (RADIUS)"
51 * "Diameter Extensible Authentication Protocol (EAP) Application"
54 * "RADIUS Attributes for Virtual LAN and Priority Support"
57 * "RADIUS Delegated-IPv6-Prefix Attribute"
60 * "RADIUS Filter Rule Attribute"
63 * "RADIUS Extension for Digest Authentication"
66 * "Dynamic Authorization Extensions to RADIUS"
69 * "Diameter Mobile IPv6"
72 * "Carrying Location Objects in RADIUS and Diameter"
75 * "RADIUS Support for Proxy Mobile IPv6"
78 * "Diameter Network Access Server Application"
80 * Alfredo Andres Omella (aandres@s21sec.com) v0.1 2000/09/15
82 * TODO: Among other things to print ok MacIntosh and Vendor values
89 #include "netdissect-stdinc.h"
93 #include "netdissect-ctype.h"
95 #include "netdissect.h"
96 #include "addrtoname.h"
102 #define TAM_SIZE(x) (sizeof(x)/sizeof(x[0]) )
104 #define PRINT_HEX(bytes_len, ptr_data) \
107 ND_PRINT("%02X", *ptr_data ); \
113 /* Radius packet codes */
114 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-27 */
115 #define RADCMD_ACCESS_REQ 1 /* Access-Request */
116 #define RADCMD_ACCESS_ACC 2 /* Access-Accept */
117 #define RADCMD_ACCESS_REJ 3 /* Access-Reject */
118 #define RADCMD_ACCOUN_REQ 4 /* Accounting-Request */
119 #define RADCMD_ACCOUN_RES 5 /* Accounting-Response */
120 #define RADCMD_ACCESS_CHA 11 /* Access-Challenge */
121 #define RADCMD_STATUS_SER 12 /* Status-Server */
122 #define RADCMD_STATUS_CLI 13 /* Status-Client */
123 #define RADCMD_DISCON_REQ 40 /* Disconnect-Request */
124 #define RADCMD_DISCON_ACK 41 /* Disconnect-ACK */
125 #define RADCMD_DISCON_NAK 42 /* Disconnect-NAK */
126 #define RADCMD_COA_REQ 43 /* CoA-Request */
127 #define RADCMD_COA_ACK 44 /* CoA-ACK */
128 #define RADCMD_COA_NAK 45 /* CoA-NAK */
129 #define RADCMD_RESERVED 255 /* Reserved */
131 static const struct tok radius_command_values
[] = {
132 { RADCMD_ACCESS_REQ
, "Access-Request" },
133 { RADCMD_ACCESS_ACC
, "Access-Accept" },
134 { RADCMD_ACCESS_REJ
, "Access-Reject" },
135 { RADCMD_ACCOUN_REQ
, "Accounting-Request" },
136 { RADCMD_ACCOUN_RES
, "Accounting-Response" },
137 { RADCMD_ACCESS_CHA
, "Access-Challenge" },
138 { RADCMD_STATUS_SER
, "Status-Server" },
139 { RADCMD_STATUS_CLI
, "Status-Client" },
140 { RADCMD_DISCON_REQ
, "Disconnect-Request" },
141 { RADCMD_DISCON_ACK
, "Disconnect-ACK" },
142 { RADCMD_DISCON_NAK
, "Disconnect-NAK" },
143 { RADCMD_COA_REQ
, "CoA-Request" },
144 { RADCMD_COA_ACK
, "CoA-ACK" },
145 { RADCMD_COA_NAK
, "CoA-NAK" },
146 { RADCMD_RESERVED
, "Reserved" },
150 /********************************/
151 /* Begin Radius Attribute types */
152 /********************************/
155 #define LOG_IPHOST 14
156 #define LOG_SERVICE 15
158 #define SESSION_TIMEOUT 27
159 #define IDLE_TIMEOUT 28
160 #define FRM_ATALK_LINK 37
161 #define FRM_ATALK_NETWORK 38
163 #define ACCT_DELAY 41
164 #define ACCT_SESSION_TIME 46
166 #define EGRESS_VLAN_ID 56
167 #define EGRESS_VLAN_NAME 58
169 #define TUNNEL_TYPE 64
170 #define TUNNEL_MEDIUM 65
171 #define TUNNEL_CLIENT_END 66
172 #define TUNNEL_SERVER_END 67
173 #define TUNNEL_PASS 69
176 #define ARAP_FEATURES 71
178 #define EAP_MESSAGE 79
180 #define TUNNEL_PRIV_GROUP 81
181 #define TUNNEL_ASSIGN_ID 82
182 #define TUNNEL_PREFERENCE 83
184 #define ARAP_CHALLENGE_RESP 84
185 #define ACCT_INT_INTERVAL 85
187 #define TUNNEL_CLIENT_AUTH 90
188 #define TUNNEL_SERVER_AUTH 91
190 #define ERROR_CAUSE 101
191 /********************************/
192 /* End Radius Attribute types */
193 /********************************/
195 #define RFC4675_TAGGED 0x31
196 #define RFC4675_UNTAGGED 0x32
198 static const struct tok rfc4675_tagged
[] = {
199 { RFC4675_TAGGED
, "Tagged" },
200 { RFC4675_UNTAGGED
, "Untagged" },
205 static void print_attr_string(netdissect_options
*, const u_char
*, u_int
, u_short
);
206 static void print_attr_num(netdissect_options
*, const u_char
*, u_int
, u_short
);
207 static void print_vendor_attr(netdissect_options
*, const u_char
*, u_int
, u_short
);
208 static void print_attr_address(netdissect_options
*, const u_char
*, u_int
, u_short
);
209 static void print_attr_address6(netdissect_options
*, const u_char
*, u_int
, u_short
);
210 static void print_attr_netmask6(netdissect_options
*, const u_char
*, u_int
, u_short
);
211 static void print_attr_mip6_home_link_prefix(netdissect_options
*, const u_char
*, u_int
, u_short
);
212 static void print_attr_operator_name(netdissect_options
*, const u_char
*, u_int
, u_short
);
213 static void print_attr_location_information(netdissect_options
*, const u_char
*, u_int
, u_short
);
214 static void print_attr_location_data(netdissect_options
*, const u_char
*, u_int
, u_short
);
215 static void print_basic_location_policy_rules(netdissect_options
*, const u_char
*, u_int
, u_short
);
216 static void print_attr_time(netdissect_options
*, const u_char
*, u_int
, u_short
);
217 static void print_attr_vector64(netdissect_options
*, register const u_char
*, u_int
, u_short
);
218 static void print_attr_strange(netdissect_options
*, const u_char
*, u_int
, u_short
);
221 struct radius_hdr
{ nd_uint8_t code
; /* Radius packet code */
222 nd_uint8_t id
; /* Radius packet id */
223 nd_uint16_t len
; /* Radius total length */
224 nd_byte auth
[16]; /* Authenticator */
227 #define MIN_RADIUS_LEN 20
229 struct radius_attr
{ nd_uint8_t type
; /* Attribute type */
230 nd_uint8_t len
; /* Attribute length */
234 /* Service-Type Attribute standard values */
235 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-4 */
236 static const char *serv_type
[]={ NULL
,
245 "Callback NAS Prompt",
248 "Callback Administrative",
256 "Additional-Authorization",
260 /* Framed-Protocol Attribute standard values */
261 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-5 */
262 static const char *frm_proto
[]={ NULL
,
266 "Gandalf proprietary",
272 /* Framed-Routing Attribute standard values */
273 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-6 */
274 static const char *frm_routing
[]={ "None",
280 /* Framed-Compression Attribute standard values */
281 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-7 */
282 static const char *frm_comp
[]={ "None",
288 /* Login-Service Attribute standard values */
289 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-8 */
290 static const char *login_serv
[]={ "Telnet",
293 "PortMaster(proprietary)",
302 /* Termination-Action Attribute standard values */
303 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-9 */
304 static const char *term_action
[]={ "Default",
308 /* Ingress-Filters Attribute standard values */
309 static const char *ingress_filters
[]={ NULL
,
314 /* NAS-Port-Type Attribute standard values */
315 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-13 */
316 static const char *nas_port_type
[]={ "Async",
323 "HDLC Clear Channel",
336 "Wireless - IEEE 802.11",
340 "Wireless - CDMA200",
345 "Wireless - IEEE 802.16",
346 "Wireless - IEEE 802.20",
347 "Wireless - IEEE 802.22",
356 "WiMAX Pre-Release 8 IWK Function",
366 /* Acct-Status-Type Accounting Attribute standard values */
367 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-10 */
368 static const char *acct_status
[]={ NULL
,
383 "Tunnel-Link-Reject",
387 /* Acct-Authentic Accounting Attribute standard values */
388 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-11 */
389 static const char *acct_auth
[]={ NULL
,
396 /* Acct-Terminate-Cause Accounting Attribute standard values */
397 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-12 */
398 static const char *acct_term
[]={ NULL
,
414 "Service Unavailable",
418 "Supplicant Restart",
420 "Reauthentication Failure",
421 "Port Reinitialized",
422 "Port Administratively Disabled",
426 /* Tunnel-Type Attribute standard values */
427 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-14 */
428 static const char *tunnel_type
[]={ NULL
,
441 "IP-in-IP Tunneling",
445 /* Tunnel-Medium-Type Attribute standard values */
446 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-15 */
447 static const char *tunnel_medium
[]={ NULL
,
463 "E.164 with NSAP subaddress",
466 /* ARAP-Zone-Access Attribute standard values */
467 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-16 */
468 static const char *arap_zone
[]={ NULL
,
469 "Only access to dfl zone",
470 "Use zone filter inc.",
472 "Use zone filter exc.",
475 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-17 */
476 static const char *prompt
[]={ "No Echo",
480 /* Error-Cause standard values */
481 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-18 */
482 #define ERROR_CAUSE_RESIDUAL_CONTEXT_REMOVED 201
483 #define ERROR_CAUSE_INVALID_EAP_PACKET 202
484 #define ERROR_CAUSE_UNSUPPORTED_ATTRIBUTE 401
485 #define ERROR_CAUSE_MISSING_ATTRIBUTE 402
486 #define ERROR_CAUSE_NAS_IDENTIFICATION_MISMATCH 403
487 #define ERROR_CAUSE_INVALID_REQUEST 404
488 #define ERROR_CAUSE_UNSUPPORTED_SERVICE 405
489 #define ERROR_CAUSE_UNSUPPORTED_EXTENSION 406
490 #define ERROR_CAUSE_INVALID_ATTRIBUTE_VALUE 407
491 #define ERROR_CAUSE_ADMINISTRATIVELY_PROHIBITED 501
492 #define ERROR_CAUSE_PROXY_REQUEST_NOT_ROUTABLE 502
493 #define ERROR_CAUSE_SESSION_CONTEXT_NOT_FOUND 503
494 #define ERROR_CAUSE_SESSION_CONTEXT_NOT_REMOVABLE 504
495 #define ERROR_CAUSE_PROXY_PROCESSING_ERROR 505
496 #define ERROR_CAUSE_RESOURCES_UNAVAILABLE 506
497 #define ERROR_CAUSE_REQUEST_INITIATED 507
498 #define ERROR_CAUSE_MULTIPLE_SESSION_SELECTION_UNSUPPORTED 508
499 #define ERROR_CAUSE_LOCATION_INFO_REQUIRED 509
500 static const struct tok errorcausetype
[] = {
501 { ERROR_CAUSE_RESIDUAL_CONTEXT_REMOVED
, "Residual Session Context Removed" },
502 { ERROR_CAUSE_INVALID_EAP_PACKET
, "Invalid EAP Packet (Ignored)" },
503 { ERROR_CAUSE_UNSUPPORTED_ATTRIBUTE
, "Unsupported Attribute" },
504 { ERROR_CAUSE_MISSING_ATTRIBUTE
, "Missing Attribute" },
505 { ERROR_CAUSE_NAS_IDENTIFICATION_MISMATCH
, "NAS Identification Mismatch" },
506 { ERROR_CAUSE_INVALID_REQUEST
, "Invalid Request" },
507 { ERROR_CAUSE_UNSUPPORTED_SERVICE
, "Unsupported Service" },
508 { ERROR_CAUSE_UNSUPPORTED_EXTENSION
, "Unsupported Extension" },
509 { ERROR_CAUSE_INVALID_ATTRIBUTE_VALUE
, "Invalid Attribute Value" },
510 { ERROR_CAUSE_ADMINISTRATIVELY_PROHIBITED
, "Administratively Prohibited" },
511 { ERROR_CAUSE_PROXY_REQUEST_NOT_ROUTABLE
, "Request Not Routable (Proxy)" },
512 { ERROR_CAUSE_SESSION_CONTEXT_NOT_FOUND
, "Session Context Not Found" },
513 { ERROR_CAUSE_SESSION_CONTEXT_NOT_REMOVABLE
, "Session Context Not Removable" },
514 { ERROR_CAUSE_PROXY_PROCESSING_ERROR
, "Other Proxy Processing Error" },
515 { ERROR_CAUSE_RESOURCES_UNAVAILABLE
, "Resources Unavailable" },
516 { ERROR_CAUSE_REQUEST_INITIATED
, "Request Initiated" },
517 { ERROR_CAUSE_MULTIPLE_SESSION_SELECTION_UNSUPPORTED
, "Multiple Session Selection Unsupported" },
518 { ERROR_CAUSE_LOCATION_INFO_REQUIRED
, "Location Info Required" },
522 /* MIP6-Feature-Vector standard values */
523 /* https://www.iana.org/assignments/aaa-parameters/aaa-parameters.xhtml */
524 #define MIP6_INTEGRATED 0x0000000000000001
525 #define LOCAL_HOME_AGENT_ASSIGNMENT 0x0000000000000002
526 #define PMIP6_SUPPORTED 0x0000010000000000
527 #define IP4_HOA_SUPPORTED 0x0000020000000000
528 #define LOCAL_MAG_ROUTING_SUPPORTED 0x0000040000000000
529 #define ASSIGN_LOCAL_IP 0x0000080000000000
530 #define MIP4_SUPPORTED 0x0000100000000000
531 #define OPTIMIZED_IDLE_MODE_MOBILITY 0x0000200000000000
532 #define GTPv2_SUPPORTED 0x0000400000000000
533 #define IP4_TRANSPORT_SUPPORTED 0x0000800000000000
534 #define IP4_HOA_ONLY_SUPPORTED 0x0001000000000000
535 #define INTER_MAG_ROUTING_SUPPORTED 0x0002000000000000
536 static const struct mip6_feature_vector
{
539 } mip6_feature_vector
[] = {
540 { MIP6_INTEGRATED
, "MIP6_INTEGRATED" },
541 { LOCAL_HOME_AGENT_ASSIGNMENT
, "LOCAL_HOME_AGENT_ASSIGNMENT" },
542 { PMIP6_SUPPORTED
, "PMIP6_SUPPORTED" },
543 { IP4_HOA_SUPPORTED
, "IP4_HOA_SUPPORTED" },
544 { LOCAL_MAG_ROUTING_SUPPORTED
, "LOCAL_MAG_ROUTING_SUPPORTED" },
545 { ASSIGN_LOCAL_IP
, "ASSIGN_LOCAL_IP" },
546 { MIP4_SUPPORTED
, "MIP4_SUPPORTED" },
547 { OPTIMIZED_IDLE_MODE_MOBILITY
, "OPTIMIZED_IDLE_MODE_MOBILITY" },
548 { GTPv2_SUPPORTED
, "GTPv2_SUPPORTED" },
549 { IP4_TRANSPORT_SUPPORTED
, "IP4_TRANSPORT_SUPPORTED" },
550 { IP4_HOA_ONLY_SUPPORTED
, "IP4_HOA_ONLY_SUPPORTED" },
551 { INTER_MAG_ROUTING_SUPPORTED
, "INTER_MAG_ROUTING_SUPPORTED" },
554 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-19 */
555 #define OPERATOR_NAME_TADIG 0x30
556 #define OPERATOR_NAME_REALM 0x31
557 #define OPERATOR_NAME_E212 0x32
558 #define OPERATOR_NAME_ICC 0x33
559 static const struct tok operator_name_vector
[] = {
560 { OPERATOR_NAME_TADIG
, "TADIG" },
561 { OPERATOR_NAME_REALM
, "REALM" },
562 { OPERATOR_NAME_E212
, "E212" },
563 { OPERATOR_NAME_ICC
, "ICC" },
567 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-20 */
568 #define LOCATION_INFORMATION_CODE_CIVIC 0
569 #define LOCATION_INFORMATION_CODE_GEOSPATIAL 1
570 static const struct tok location_information_code_vector
[] = {
571 { LOCATION_INFORMATION_CODE_CIVIC
, "Civic" },
572 { LOCATION_INFORMATION_CODE_GEOSPATIAL
, "Geospatial" },
576 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-21 */
577 #define LOCATION_INFORMATION_ENTITY_USER 0
578 #define LOCATION_INFORMATION_ENTITY_RADIUS 1
579 static const struct tok location_information_entity_vector
[] = {
580 { LOCATION_INFORMATION_ENTITY_USER
, "User" },
581 { LOCATION_INFORMATION_ENTITY_RADIUS
, "RADIUS" },
585 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-22 */
586 static const struct tok blpr_bm
[] = {
587 { 0x0001, "MBZ-15" },
588 { 0x0002, "MBZ-14" },
589 { 0x0004, "MBZ-13" },
590 { 0x0008, "MBZ-12" },
591 { 0x0010, "MBZ-11" },
592 { 0x0020, "MBZ-10" },
602 { 0x8000, "Retransmission Allowed" },
606 /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-2 */
607 static const struct attrtype
{
608 const char *name
; /* Attribute name */
609 const char **subtypes
; /* Standard Values (if any) */
610 u_char siz_subtypes
; /* Size of total standard values */
611 u_char first_subtype
; /* First standard value is 0 or 1 */
612 void (*print_func
)(netdissect_options
*, const u_char
*, u_int
, u_short
);
615 { NULL
, NULL
, 0, 0, NULL
},
616 { "User-Name", NULL
, 0, 0, print_attr_string
},
617 { "User-Password", NULL
, 0, 0, NULL
},
618 { "CHAP-Password", NULL
, 0, 0, NULL
},
619 { "NAS-IP-Address", NULL
, 0, 0, print_attr_address
},
620 { "NAS-Port", NULL
, 0, 0, print_attr_num
},
621 { "Service-Type", serv_type
, TAM_SIZE(serv_type
)-1, 1, print_attr_num
},
622 { "Framed-Protocol", frm_proto
, TAM_SIZE(frm_proto
)-1, 1, print_attr_num
},
623 { "Framed-IP-Address", NULL
, 0, 0, print_attr_address
},
624 { "Framed-IP-Netmask", NULL
, 0, 0, print_attr_address
},
626 { "Framed-Routing", frm_routing
, TAM_SIZE(frm_routing
), 0, print_attr_num
},
627 { "Filter-Id", NULL
, 0, 0, print_attr_string
},
628 { "Framed-MTU", NULL
, 0, 0, print_attr_num
},
629 { "Framed-Compression", frm_comp
, TAM_SIZE(frm_comp
), 0, print_attr_num
},
630 { "Login-IP-Host", NULL
, 0, 0, print_attr_address
},
631 { "Login-Service", login_serv
, TAM_SIZE(login_serv
), 0, print_attr_num
},
632 { "Login-TCP-Port", NULL
, 0, 0, print_attr_num
},
633 { "Unassigned", NULL
, 0, 0, NULL
}, /*17*/
634 { "Reply-Message", NULL
, 0, 0, print_attr_string
},
635 { "Callback-Number", NULL
, 0, 0, print_attr_string
},
637 { "Callback-Id", NULL
, 0, 0, print_attr_string
},
638 { "Unassigned", NULL
, 0, 0, NULL
}, /*21*/
639 { "Framed-Route", NULL
, 0, 0, print_attr_string
},
640 { "Framed-IPX-Network", NULL
, 0, 0, print_attr_num
},
641 { "State", NULL
, 0, 0, print_attr_string
},
642 { "Class", NULL
, 0, 0, print_attr_string
},
643 { "Vendor-Specific", NULL
, 0, 0, print_vendor_attr
},
644 { "Session-Timeout", NULL
, 0, 0, print_attr_num
},
645 { "Idle-Timeout", NULL
, 0, 0, print_attr_num
},
646 { "Termination-Action", term_action
, TAM_SIZE(term_action
), 0, print_attr_num
},
648 { "Called-Station-Id", NULL
, 0, 0, print_attr_string
},
649 { "Calling-Station-Id", NULL
, 0, 0, print_attr_string
},
650 { "NAS-Identifier", NULL
, 0, 0, print_attr_string
},
651 { "Proxy-State", NULL
, 0, 0, print_attr_string
},
652 { "Login-LAT-Service", NULL
, 0, 0, print_attr_string
},
653 { "Login-LAT-Node", NULL
, 0, 0, print_attr_string
},
654 { "Login-LAT-Group", NULL
, 0, 0, print_attr_string
},
655 { "Framed-AppleTalk-Link", NULL
, 0, 0, print_attr_num
},
656 { "Framed-AppleTalk-Network", NULL
, 0, 0, print_attr_num
},
657 { "Framed-AppleTalk-Zone", NULL
, 0, 0, print_attr_string
},
659 { "Acct-Status-Type", acct_status
, TAM_SIZE(acct_status
)-1, 1, print_attr_num
},
660 { "Acct-Delay-Time", NULL
, 0, 0, print_attr_num
},
661 { "Acct-Input-Octets", NULL
, 0, 0, print_attr_num
},
662 { "Acct-Output-Octets", NULL
, 0, 0, print_attr_num
},
663 { "Acct-Session-Id", NULL
, 0, 0, print_attr_string
},
664 { "Acct-Authentic", acct_auth
, TAM_SIZE(acct_auth
)-1, 1, print_attr_num
},
665 { "Acct-Session-Time", NULL
, 0, 0, print_attr_num
},
666 { "Acct-Input-Packets", NULL
, 0, 0, print_attr_num
},
667 { "Acct-Output-Packets", NULL
, 0, 0, print_attr_num
},
668 { "Acct-Terminate-Cause", acct_term
, TAM_SIZE(acct_term
)-1, 1, print_attr_num
},
670 { "Acct-Multi-Session-Id", NULL
, 0, 0, print_attr_string
},
671 { "Acct-Link-Count", NULL
, 0, 0, print_attr_num
},
672 { "Acct-Input-Gigawords", NULL
, 0, 0, print_attr_num
},
673 { "Acct-Output-Gigawords", NULL
, 0, 0, print_attr_num
},
674 { "Unassigned", NULL
, 0, 0, NULL
}, /*54*/
675 { "Event-Timestamp", NULL
, 0, 0, print_attr_time
},
676 { "Egress-VLANID", NULL
, 0, 0, print_attr_num
},
677 { "Ingress-Filters", ingress_filters
, TAM_SIZE(ingress_filters
)-1, 1, print_attr_num
},
678 { "Egress-VLAN-Name", NULL
, 0, 0, print_attr_string
},
679 { "User-Priority-Table", NULL
, 0, 0, NULL
},
681 { "CHAP-Challenge", NULL
, 0, 0, print_attr_string
},
682 { "NAS-Port-Type", nas_port_type
, TAM_SIZE(nas_port_type
), 0, print_attr_num
},
683 { "Port-Limit", NULL
, 0, 0, print_attr_num
},
684 { "Login-LAT-Port", NULL
, 0, 0, print_attr_string
}, /*63*/
685 { "Tunnel-Type", tunnel_type
, TAM_SIZE(tunnel_type
)-1, 1, print_attr_num
},
686 { "Tunnel-Medium-Type", tunnel_medium
, TAM_SIZE(tunnel_medium
)-1, 1, print_attr_num
},
687 { "Tunnel-Client-Endpoint", NULL
, 0, 0, print_attr_string
},
688 { "Tunnel-Server-Endpoint", NULL
, 0, 0, print_attr_string
},
689 { "Acct-Tunnel-Connection", NULL
, 0, 0, print_attr_string
},
690 { "Tunnel-Password", NULL
, 0, 0, print_attr_string
},
692 { "ARAP-Password", NULL
, 0, 0, print_attr_strange
},
693 { "ARAP-Features", NULL
, 0, 0, print_attr_strange
},
694 { "ARAP-Zone-Access", arap_zone
, TAM_SIZE(arap_zone
)-1, 1, print_attr_num
}, /*72*/
695 { "ARAP-Security", NULL
, 0, 0, print_attr_string
},
696 { "ARAP-Security-Data", NULL
, 0, 0, print_attr_string
},
697 { "Password-Retry", NULL
, 0, 0, print_attr_num
},
698 { "Prompt", prompt
, TAM_SIZE(prompt
), 0, print_attr_num
},
699 { "Connect-Info", NULL
, 0, 0, print_attr_string
},
700 { "Configuration-Token", NULL
, 0, 0, print_attr_string
},
701 { "EAP-Message", NULL
, 0, 0, print_attr_string
},
703 { "Message-Authenticator", NULL
, 0, 0, print_attr_string
}, /*80*/
704 { "Tunnel-Private-Group-ID", NULL
, 0, 0, print_attr_string
},
705 { "Tunnel-Assignment-ID", NULL
, 0, 0, print_attr_string
},
706 { "Tunnel-Preference", NULL
, 0, 0, print_attr_num
},
707 { "ARAP-Challenge-Response", NULL
, 0, 0, print_attr_strange
},
708 { "Acct-Interim-Interval", NULL
, 0, 0, print_attr_num
},
709 { "Acct-Tunnel-Packets-Lost", NULL
, 0, 0, print_attr_num
}, /*86*/
710 { "NAS-Port-Id", NULL
, 0, 0, print_attr_string
},
711 { "Framed-Pool", NULL
, 0, 0, print_attr_string
},
712 { "CUI", NULL
, 0, 0, print_attr_string
},
714 { "Tunnel-Client-Auth-ID", NULL
, 0, 0, print_attr_string
},
715 { "Tunnel-Server-Auth-ID", NULL
, 0, 0, print_attr_string
},
716 { "NAS-Filter-Rule", NULL
, 0, 0, print_attr_string
},
717 { "Unassigned", NULL
, 0, 0, NULL
}, /*93*/
718 { "Originating-Line-Info", NULL
, 0, 0, NULL
},
719 { "NAS-IPv6-Address", NULL
, 0, 0, print_attr_address6
},
720 { "Framed-Interface-ID", NULL
, 0, 0, NULL
},
721 { "Framed-IPv6-Prefix", NULL
, 0, 0, print_attr_netmask6
},
722 { "Login-IPv6-Host", NULL
, 0, 0, print_attr_address6
},
723 { "Framed-IPv6-Route", NULL
, 0, 0, print_attr_string
},
725 { "Framed-IPv6-Pool", NULL
, 0, 0, print_attr_string
},
726 { "Error-Cause", NULL
, 0, 0, print_attr_strange
},
727 { "EAP-Key-Name", NULL
, 0, 0, NULL
},
728 { "Digest-Response", NULL
, 0, 0, print_attr_string
},
729 { "Digest-Realm", NULL
, 0, 0, print_attr_string
},
730 { "Digest-Nonce", NULL
, 0, 0, print_attr_string
},
731 { "Digest-Response-Auth", NULL
, 0, 0, print_attr_string
},
732 { "Digest-Nextnonce", NULL
, 0, 0, print_attr_string
},
733 { "Digest-Method", NULL
, 0, 0, print_attr_string
},
734 { "Digest-URI", NULL
, 0, 0, print_attr_string
},
736 { "Digest-Qop", NULL
, 0, 0, print_attr_string
},
737 { "Digest-Algorithm", NULL
, 0, 0, print_attr_string
},
738 { "Digest-Entity-Body-Hash", NULL
, 0, 0, print_attr_string
},
739 { "Digest-CNonce", NULL
, 0, 0, print_attr_string
},
740 { "Digest-Nonce-Count", NULL
, 0, 0, print_attr_string
},
741 { "Digest-Username", NULL
, 0, 0, print_attr_string
},
742 { "Digest-Opaque", NULL
, 0, 0, print_attr_string
},
743 { "Digest-Auth-Param", NULL
, 0, 0, print_attr_string
},
744 { "Digest-AKA-Auts", NULL
, 0, 0, print_attr_string
},
745 { "Digest-Domain", NULL
, 0, 0, print_attr_string
},
747 { "Digest-Stale", NULL
, 0, 0, print_attr_string
},
748 { "Digest-HA1", NULL
, 0, 0, print_attr_string
},
749 { "SIP-AOR", NULL
, 0, 0, print_attr_string
},
750 { "Delegated-IPv6-Prefix", NULL
, 0, 0, print_attr_netmask6
},
751 { "MIP6-Feature-Vector", NULL
, 0, 0, print_attr_vector64
},
752 { "MIP6-Home-Link-Prefix", NULL
, 0, 0, print_attr_mip6_home_link_prefix
},
753 { "Operator-Name", NULL
, 0, 0, print_attr_operator_name
},
754 { "Location-Information", NULL
, 0, 0, print_attr_location_information
},
755 { "Location-Data", NULL
, 0, 0, print_attr_location_data
},
756 { "Basic-Location-Policy-Rules", NULL
, 0, 0, print_basic_location_policy_rules
}
761 /*****************************/
762 /* Print an attribute string */
763 /* value pointed by 'data' */
764 /* and 'length' size. */
765 /*****************************/
766 /* Returns nothing. */
767 /*****************************/
769 print_attr_string(netdissect_options
*ndo
,
770 const u_char
*data
, u_int length
, u_short attr_code
)
774 ND_TCHECK_LEN(data
, length
);
781 if (GET_U_1(data
) && (GET_U_1(data
) <= 0x1F))
782 ND_PRINT("Tag[%u] ", GET_U_1(data
));
784 ND_PRINT("Tag[Unused] ");
787 ND_PRINT("Salt %u ", GET_BE_U_2(data
));
791 case TUNNEL_CLIENT_END
:
792 case TUNNEL_SERVER_END
:
793 case TUNNEL_PRIV_GROUP
:
794 case TUNNEL_ASSIGN_ID
:
795 case TUNNEL_CLIENT_AUTH
:
796 case TUNNEL_SERVER_AUTH
:
797 if (GET_U_1(data
) <= 0x1F)
802 ND_PRINT("Tag[%u] ", GET_U_1(data
));
804 ND_PRINT("Tag[Unused] ");
809 case EGRESS_VLAN_NAME
:
812 ND_PRINT("%s (0x%02x) ",
813 tok2str(rfc4675_tagged
,"Unknown tag",GET_U_1(data
)),
821 eap_print(ndo
, data
, length
);
825 for (i
=0; i
< length
&& GET_U_1(data
); i
++, data
++)
826 ND_PRINT("%c", ND_ASCII_ISPRINT(GET_U_1(data
)) ? GET_U_1(data
) : '.');
835 * print vendor specific attributes
838 print_vendor_attr(netdissect_options
*ndo
,
839 const u_char
*data
, u_int length
, u_short attr_code _U_
)
849 vendor_id
= GET_BE_U_4(data
);
853 ND_PRINT("Vendor: %s (%u)",
854 tok2str(smi_values
,"Unknown",vendor_id
),
857 while (length
>= 2) {
860 vendor_type
= GET_U_1(data
);
861 vendor_length
= GET_U_1(data
+ 1);
863 if (vendor_length
< 2)
865 ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, must be >= 2)",
870 if (vendor_length
> length
)
872 ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, goes past end of vendor-specific attribute)",
880 ND_TCHECK_LEN(data
, vendor_length
);
882 ND_PRINT("\n\t Vendor Attribute: %u, Length: %u, Value: ",
885 for (idx
= 0; idx
< vendor_length
; idx
++, data
++)
886 ND_PRINT("%c", ND_ASCII_ISPRINT(GET_U_1(data
)) ? GET_U_1(data
) : '.');
887 length
-=vendor_length
;
895 /******************************/
896 /* Print an attribute numeric */
897 /* value pointed by 'data' */
898 /* and 'length' size. */
899 /******************************/
900 /* Returns nothing. */
901 /******************************/
903 print_attr_num(netdissect_options
*ndo
,
904 const u_char
*data
, u_int length
, u_short attr_code
)
910 ND_PRINT("ERROR: length %u != 4", length
);
915 /* This attribute has standard values */
916 if (attr_type
[attr_code
].siz_subtypes
)
918 static const char **table
;
920 table
= attr_type
[attr_code
].subtypes
;
922 if ( (attr_code
== TUNNEL_TYPE
) || (attr_code
== TUNNEL_MEDIUM
) )
925 ND_PRINT("Tag[Unused] ");
927 ND_PRINT("Tag[%u] ", GET_U_1(data
));
929 data_value
= GET_BE_U_3(data
);
933 data_value
= GET_BE_U_4(data
);
935 if ( data_value
<= (uint32_t)(attr_type
[attr_code
].siz_subtypes
- 1 +
936 attr_type
[attr_code
].first_subtype
) &&
937 data_value
>= attr_type
[attr_code
].first_subtype
)
938 ND_PRINT("%s", table
[data_value
]);
940 ND_PRINT("#%u", data_value
);
944 switch(attr_code
) /* Be aware of special cases... */
947 if (GET_BE_U_4(data
) == 0xFFFFFFFE )
948 ND_PRINT("NAS Select");
950 ND_PRINT("%u", GET_BE_U_4(data
));
953 case SESSION_TIMEOUT
:
956 case ACCT_SESSION_TIME
:
957 case ACCT_INT_INTERVAL
:
958 timeout
= GET_BE_U_4(data
);
960 ND_PRINT("%02d secs", timeout
);
963 if ( timeout
< 3600 )
964 ND_PRINT("%02d:%02d min",
965 timeout
/ 60, timeout
% 60);
967 ND_PRINT("%02d:%02d:%02d hours",
968 timeout
/ 3600, (timeout
% 3600) / 60,
974 if (GET_BE_U_4(data
))
975 ND_PRINT("%u", GET_BE_U_4(data
));
977 ND_PRINT("Unnumbered");
980 case FRM_ATALK_NETWORK
:
981 if (GET_BE_U_4(data
))
982 ND_PRINT("%u", GET_BE_U_4(data
));
984 ND_PRINT("NAS assigned");
987 case TUNNEL_PREFERENCE
:
989 ND_PRINT("Tag[%u] ", GET_U_1(data
));
991 ND_PRINT("Tag[Unused] ");
993 ND_PRINT("%u", GET_BE_U_3(data
));
997 ND_PRINT("%s (0x%02x) ",
998 tok2str(rfc4675_tagged
,"Unknown tag",GET_U_1(data
)),
1001 ND_PRINT("%u", GET_BE_U_3(data
));
1005 ND_PRINT("%u", GET_BE_U_4(data
));
1015 nd_print_trunc(ndo
);
1018 /*****************************/
1019 /* Print an attribute IPv4 */
1020 /* address value pointed by */
1021 /* 'data' and 'length' size. */
1022 /*****************************/
1023 /* Returns nothing. */
1024 /*****************************/
1026 print_attr_address(netdissect_options
*ndo
,
1027 const u_char
*data
, u_int length
, u_short attr_code
)
1031 ND_PRINT("ERROR: length %u != 4", length
);
1041 if (GET_BE_U_4(data
) == 0xFFFFFFFF )
1042 ND_PRINT("User Selected");
1044 if (GET_BE_U_4(data
) == 0xFFFFFFFE )
1045 ND_PRINT("NAS Select");
1047 ND_PRINT("%s",GET_IPADDR_STRING(data
));
1051 ND_PRINT("%s", GET_IPADDR_STRING(data
));
1058 nd_print_trunc(ndo
);
1061 /*****************************/
1062 /* Print an attribute IPv6 */
1063 /* address value pointed by */
1064 /* 'data' and 'length' size. */
1065 /*****************************/
1066 /* Returns nothing. */
1067 /*****************************/
1069 print_attr_address6(netdissect_options
*ndo
,
1070 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1074 ND_PRINT("ERROR: length %u != 16", length
);
1080 ND_PRINT("%s", GET_IP6ADDR_STRING(data
));
1085 nd_print_trunc(ndo
);
1089 print_attr_netmask6(netdissect_options
*ndo
,
1090 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1094 if (length
< 2 || length
> 18)
1096 ND_PRINT("ERROR: length %u not in range (2..18)", length
);
1099 ND_TCHECK_LEN(data
, length
);
1100 if (GET_U_1(data
+ 1) > 128)
1102 ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data
+ 1));
1106 memset(data2
, 0, sizeof(data2
));
1108 memcpy(data2
, data
+2, length
-2);
1110 ND_PRINT("%s/%u", ip6addr_string(ndo
, data2
), GET_U_1(data
+ 1));
1112 if (GET_U_1(data
+ 1) > 8 * (length
- 2))
1113 ND_PRINT(" (inconsistent prefix length)");
1118 nd_print_trunc(ndo
);
1122 print_attr_mip6_home_link_prefix(netdissect_options
*ndo
,
1123 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1127 ND_PRINT("ERROR: length %u != 17", length
);
1130 ND_TCHECK_LEN(data
, length
);
1131 if (GET_U_1(data
) > 128)
1133 ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data
));
1137 ND_PRINT("%s/%u", GET_IP6ADDR_STRING(data
+ 1), GET_U_1(data
));
1142 nd_print_trunc(ndo
);
1146 print_attr_operator_name(netdissect_options
*ndo
,
1147 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1149 u_int namespace_value
;
1151 ND_TCHECK_LEN(data
, length
);
1154 ND_PRINT("ERROR: length %u < 2", length
);
1157 namespace_value
= GET_U_1(data
);
1159 ND_PRINT("[%s] ", tok2str(operator_name_vector
, "unknown namespace %u", namespace_value
));
1161 nd_printn(ndo
, data
, length
- 1, NULL
);
1166 nd_print_trunc(ndo
);
1170 print_attr_location_information(netdissect_options
*ndo
,
1171 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1174 uint8_t code
, entity
;
1176 ND_TCHECK_LEN(data
, length
);
1179 ND_PRINT("ERROR: length %u < 21", length
);
1183 index
= GET_BE_U_2(data
);
1186 code
= GET_U_1(data
);
1189 entity
= GET_U_1(data
);
1192 ND_PRINT("index %u, code %s, entity %s, ",
1194 tok2str(location_information_code_vector
, "Unknown (%u)", code
),
1195 tok2str(location_information_entity_vector
, "Unknown (%u)", entity
)
1198 ND_PRINT("sighting time ");
1199 p_ntp_time(ndo
, (const struct l_fixedpt
*)data
);
1203 ND_PRINT("time to live ");
1204 p_ntp_time(ndo
, (const struct l_fixedpt
*)data
);
1208 ND_PRINT("method \"");
1209 nd_printn(ndo
, data
, length
- 20, NULL
);
1215 nd_print_trunc(ndo
);
1219 print_attr_location_data(netdissect_options
*ndo
,
1220 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1224 ND_TCHECK_LEN(data
, length
);
1227 ND_PRINT("ERROR: length %u < 3", length
);
1231 index
= GET_BE_U_2(data
);
1233 ND_PRINT("index %u, location", index
);
1235 /* The Location field of the String field of the Location-Data attribute
1236 * can have two completely different structures depending on the value of
1237 * the Code field of a Location-Info attribute, which supposedly precedes
1238 * the current attribute. Unfortunately, this choice of encoding makes it
1239 * non-trivial to decode the Location field without preserving some state
1240 * between the attributes.
1242 hex_and_ascii_print(ndo
, "\n\t ", data
, length
- 2);
1247 nd_print_trunc(ndo
);
1251 print_basic_location_policy_rules(netdissect_options
*ndo
,
1252 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1256 ND_TCHECK_LEN(data
, length
);
1259 ND_PRINT("ERROR: length %u < 10", length
);
1263 flags
= GET_BE_U_2(data
);
1265 ND_PRINT("flags [%s], ", bittok2str(blpr_bm
, "none", flags
));
1267 ND_PRINT("retention expires ");
1268 p_ntp_time(ndo
, (const struct l_fixedpt
*)data
);
1272 ND_PRINT(", note well \"");
1273 nd_printn(ndo
, data
, length
- 10, NULL
);
1280 nd_print_trunc(ndo
);
1284 /*************************************/
1285 /* Print an attribute of 'secs since */
1286 /* January 1, 1970 00:00 UTC' value */
1287 /* pointed by 'data' and 'length' */
1289 /*************************************/
1290 /* Returns nothing. */
1291 /*************************************/
1293 print_attr_time(netdissect_options
*ndo
,
1294 const u_char
*data
, u_int length
, u_short attr_code _U_
)
1301 ND_PRINT("ERROR: length %u != 4", length
);
1307 attr_time
= GET_BE_U_4(data
);
1308 strlcpy(string
, ctime(&attr_time
), sizeof(string
));
1309 /* Get rid of the newline */
1311 ND_PRINT("%.24s", string
);
1315 nd_print_trunc(ndo
);
1319 print_attr_vector64(netdissect_options
*ndo
,
1320 register const u_char
*data
, u_int length
, u_short attr_code _U_
)
1322 uint64_t data_value
, i
;
1323 const char *sep
= "";
1327 ND_PRINT("ERROR: length %u != 8", length
);
1333 data_value
= GET_BE_U_8(data
);
1334 /* Print the 64-bit field in a format similar to bittok2str(), less
1335 * flagging any unknown bits. This way it should be easier to replace
1336 * the custom code with a library function later.
1338 for (i
= 0; i
< TAM_SIZE(mip6_feature_vector
); i
++) {
1339 if (data_value
& mip6_feature_vector
[i
].v
) {
1340 ND_PRINT("%s%s", sep
, mip6_feature_vector
[i
].s
);
1350 /***********************************/
1351 /* Print an attribute of 'strange' */
1352 /* data format pointed by 'data' */
1353 /* and 'length' size. */
1354 /***********************************/
1355 /* Returns nothing. */
1356 /***********************************/
1358 print_attr_strange(netdissect_options
*ndo
,
1359 const u_char
*data
, u_int length
, u_short attr_code
)
1362 u_int error_cause_value
;
1369 ND_PRINT("ERROR: length %u != 16", length
);
1372 ND_PRINT("User_challenge (");
1375 PRINT_HEX(len_data
, data
);
1376 ND_PRINT(") User_resp(");
1379 PRINT_HEX(len_data
, data
);
1386 ND_PRINT("ERROR: length %u != 14", length
);
1391 ND_PRINT("User can change password");
1393 ND_PRINT("User cannot change password");
1396 ND_PRINT(", Min password length: %u", GET_U_1(data
));
1398 ND_PRINT(", created at: ");
1401 PRINT_HEX(len_data
, data
);
1402 ND_PRINT(", expires in: ");
1405 PRINT_HEX(len_data
, data
);
1406 ND_PRINT(", Current Time: ");
1409 PRINT_HEX(len_data
, data
);
1412 case ARAP_CHALLENGE_RESP
:
1415 ND_PRINT("ERROR: length %u != 8", length
);
1420 PRINT_HEX(len_data
, data
);
1426 ND_PRINT("Error: length %u != 4", length
);
1431 error_cause_value
= GET_BE_U_4(data
);
1432 ND_PRINT("Error cause %u: %s", error_cause_value
, tok2str(errorcausetype
, "Error-Cause %u not known", error_cause_value
));
1438 nd_print_trunc(ndo
);
1442 radius_attrs_print(netdissect_options
*ndo
,
1443 const u_char
*attr
, u_int length
)
1445 const struct radius_attr
*rad_attr
= (const struct radius_attr
*)attr
;
1446 const char *attr_string
;
1453 ND_TCHECK_SIZE(rad_attr
);
1455 type
= GET_U_1(rad_attr
->type
);
1456 len
= GET_U_1(rad_attr
->len
);
1457 if (type
!= 0 && type
< TAM_SIZE(attr_type
))
1458 attr_string
= attr_type
[type
].name
;
1460 attr_string
= "Unknown";
1462 ND_PRINT("\n\t %s Attribute (%u), length: %u",
1468 ND_PRINT(" (bogus, must be >= 2)");
1473 ND_PRINT(" (bogus, goes past end of packet)");
1476 ND_PRINT(", Value: ");
1478 if (type
< TAM_SIZE(attr_type
))
1482 if ( attr_type
[type
].print_func
)
1483 (*attr_type
[type
].print_func
)(
1484 ndo
, ((const u_char
*)(rad_attr
+1)),
1488 /* do we also want to see a hex dump ? */
1489 if (ndo
->ndo_vflag
> 1)
1490 print_unknown_data(ndo
, (const u_char
*)rad_attr
+2, "\n\t ", (len
)-2);
1493 rad_attr
= (const struct radius_attr
*)( ((const char *)(rad_attr
))+len
);
1498 nd_print_trunc(ndo
);
1502 radius_print(netdissect_options
*ndo
,
1503 const u_char
*dat
, u_int length
)
1505 const struct radius_hdr
*rad
;
1506 u_int len
, auth_idx
;
1508 ndo
->ndo_protocol
= "radius";
1509 ND_TCHECK_LEN(dat
, MIN_RADIUS_LEN
);
1510 rad
= (const struct radius_hdr
*)dat
;
1511 len
= GET_BE_U_2(rad
->len
);
1513 if (len
< MIN_RADIUS_LEN
)
1515 nd_print_trunc(ndo
);
1522 if (ndo
->ndo_vflag
< 1) {
1523 ND_PRINT("RADIUS, %s (%u), id: 0x%02x length: %u",
1524 tok2str(radius_command_values
,"Unknown Command",GET_U_1(rad
->code
)),
1531 ND_PRINT("RADIUS, length: %u\n\t%s (%u), id: 0x%02x, Authenticator: ",
1533 tok2str(radius_command_values
,"Unknown Command",GET_U_1(rad
->code
)),
1537 for(auth_idx
=0; auth_idx
< 16; auth_idx
++)
1538 ND_PRINT("%02x", rad
->auth
[auth_idx
]);
1541 if (len
> MIN_RADIUS_LEN
)
1542 radius_attrs_print(ndo
, dat
+ MIN_RADIUS_LEN
, len
- MIN_RADIUS_LEN
);
1546 nd_print_trunc(ndo
);