Home | History | Annotate | Line # | Download | only in dist
print-radius.c revision 1.1.1.10
      1       1.1  christos /*
      2       1.1  christos  * Copyright (C) 2000 Alfredo Andres Omella.  All rights reserved.
      3       1.1  christos  *
      4       1.1  christos  * Redistribution and use in source and binary forms, with or without
      5       1.1  christos  * modification, are permitted provided that the following conditions
      6       1.1  christos  * are met:
      7       1.1  christos  *
      8       1.1  christos  *   1. Redistributions of source code must retain the above copyright
      9       1.1  christos  *      notice, this list of conditions and the following disclaimer.
     10       1.1  christos  *   2. Redistributions in binary form must reproduce the above copyright
     11       1.1  christos  *      notice, this list of conditions and the following disclaimer in
     12       1.1  christos  *      the documentation and/or other materials provided with the
     13       1.1  christos  *      distribution.
     14       1.1  christos  *   3. The names of the authors may not be used to endorse or promote
     15       1.1  christos  *      products derived from this software without specific prior
     16       1.1  christos  *      written permission.
     17       1.1  christos  *
     18       1.1  christos  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
     19       1.1  christos  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
     20       1.1  christos  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
     21       1.1  christos  */
     22   1.1.1.7       spz 
     23   1.1.1.7       spz /* \summary: Radius protocol printer */
     24   1.1.1.7       spz 
     25       1.1  christos /*
     26       1.1  christos  * Radius printer routines as specified on:
     27       1.1  christos  *
     28       1.1  christos  * RFC 2865:
     29       1.1  christos  *      "Remote Authentication Dial In User Service (RADIUS)"
     30       1.1  christos  *
     31       1.1  christos  * RFC 2866:
     32       1.1  christos  *      "RADIUS Accounting"
     33       1.1  christos  *
     34       1.1  christos  * RFC 2867:
     35       1.1  christos  *      "RADIUS Accounting Modifications for Tunnel Protocol Support"
     36       1.1  christos  *
     37       1.1  christos  * RFC 2868:
     38       1.1  christos  *      "RADIUS Attributes for Tunnel Protocol Support"
     39       1.1  christos  *
     40       1.1  christos  * RFC 2869:
     41       1.1  christos  *      "RADIUS Extensions"
     42       1.1  christos  *
     43   1.1.1.9  christos  * RFC 3162:
     44   1.1.1.9  christos  *      "RADIUS and IPv6"
     45   1.1.1.9  christos  *
     46   1.1.1.6  christos  * RFC 3580:
     47   1.1.1.6  christos  *      "IEEE 802.1X Remote Authentication Dial In User Service (RADIUS)"
     48   1.1.1.6  christos  *      "Usage Guidelines"
     49   1.1.1.6  christos  *
     50   1.1.1.9  christos  * RFC 4072:
     51   1.1.1.9  christos  *      "Diameter Extensible Authentication Protocol (EAP) Application"
     52   1.1.1.9  christos  *
     53   1.1.1.5  christos  * RFC 4675:
     54   1.1.1.5  christos  *      "RADIUS Attributes for Virtual LAN and Priority Support"
     55   1.1.1.5  christos  *
     56   1.1.1.9  christos  * RFC 4818:
     57   1.1.1.9  christos  *      "RADIUS Delegated-IPv6-Prefix Attribute"
     58   1.1.1.9  christos  *
     59   1.1.1.9  christos  * RFC 4849:
     60   1.1.1.9  christos  *      "RADIUS Filter Rule Attribute"
     61   1.1.1.9  christos  *
     62   1.1.1.9  christos  * RFC 5090:
     63   1.1.1.9  christos  *      "RADIUS Extension for Digest Authentication"
     64   1.1.1.9  christos  *
     65   1.1.1.5  christos  * RFC 5176:
     66   1.1.1.5  christos  *      "Dynamic Authorization Extensions to RADIUS"
     67   1.1.1.5  christos  *
     68   1.1.1.9  christos  * RFC 5447:
     69   1.1.1.9  christos  *      "Diameter Mobile IPv6"
     70   1.1.1.9  christos  *
     71   1.1.1.9  christos  * RFC 5580:
     72   1.1.1.9  christos  *      "Carrying Location Objects in RADIUS and Diameter"
     73   1.1.1.9  christos  *
     74   1.1.1.9  christos  * RFC 6572:
     75   1.1.1.9  christos  *      "RADIUS Support for Proxy Mobile IPv6"
     76   1.1.1.9  christos  *
     77   1.1.1.9  christos  * RFC 7155:
     78   1.1.1.9  christos  *      "Diameter Network Access Server Application"
     79   1.1.1.9  christos  *
     80       1.1  christos  * Alfredo Andres Omella (aandres (at) s21sec.com) v0.1 2000/09/15
     81       1.1  christos  *
     82       1.1  christos  * TODO: Among other things to print ok MacIntosh and Vendor values
     83       1.1  christos  */
     84       1.1  christos 
     85   1.1.1.9  christos #include <config.h>
     86       1.1  christos 
     87   1.1.1.9  christos #include "netdissect-stdinc.h"
     88       1.1  christos 
     89       1.1  christos #include <string.h>
     90       1.1  christos 
     91   1.1.1.9  christos #include "netdissect-ctype.h"
     92   1.1.1.9  christos 
     93   1.1.1.6  christos #include "netdissect.h"
     94       1.1  christos #include "addrtoname.h"
     95       1.1  christos #include "extract.h"
     96       1.1  christos #include "oui.h"
     97   1.1.1.9  christos #include "ntp.h"
     98       1.1  christos 
     99   1.1.1.4  christos 
    100       1.1  christos #define TAM_SIZE(x) (sizeof(x)/sizeof(x[0]) )
    101       1.1  christos 
    102       1.1  christos #define PRINT_HEX(bytes_len, ptr_data)                               \
    103       1.1  christos            while(bytes_len)                                          \
    104       1.1  christos            {                                                         \
    105   1.1.1.9  christos               ND_PRINT("%02X", GET_U_1(ptr_data));                   \
    106       1.1  christos               ptr_data++;                                            \
    107       1.1  christos               bytes_len--;                                           \
    108       1.1  christos            }
    109       1.1  christos 
    110       1.1  christos 
    111       1.1  christos /* Radius packet codes */
    112   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-27 */
    113  1.1.1.10  christos #define RADCMD_ACCESS_REQ    1 /* Access-Request      */
    114  1.1.1.10  christos #define RADCMD_ACCESS_ACC    2 /* Access-Accept       */
    115  1.1.1.10  christos #define RADCMD_ACCESS_REJ    3 /* Access-Reject       */
    116  1.1.1.10  christos #define RADCMD_ACCOUNT_REQ   4 /* Accounting-Request  */
    117  1.1.1.10  christos #define RADCMD_ACCOUNT_RES   5 /* Accounting-Response */
    118  1.1.1.10  christos #define RADCMD_ACCESS_CHA   11 /* Access-Challenge    */
    119  1.1.1.10  christos #define RADCMD_STATUS_SER   12 /* Status-Server       */
    120  1.1.1.10  christos #define RADCMD_STATUS_CLI   13 /* Status-Client       */
    121  1.1.1.10  christos #define RADCMD_DISCON_REQ   40 /* Disconnect-Request  */
    122  1.1.1.10  christos #define RADCMD_DISCON_ACK   41 /* Disconnect-ACK      */
    123  1.1.1.10  christos #define RADCMD_DISCON_NAK   42 /* Disconnect-NAK      */
    124  1.1.1.10  christos #define RADCMD_COA_REQ      43 /* CoA-Request         */
    125  1.1.1.10  christos #define RADCMD_COA_ACK      44 /* CoA-ACK             */
    126  1.1.1.10  christos #define RADCMD_COA_NAK      45 /* CoA-NAK             */
    127  1.1.1.10  christos #define RADCMD_RESERVED    255 /* Reserved            */
    128       1.1  christos 
    129   1.1.1.3  christos static const struct tok radius_command_values[] = {
    130  1.1.1.10  christos     { RADCMD_ACCESS_REQ,  "Access-Request" },
    131  1.1.1.10  christos     { RADCMD_ACCESS_ACC,  "Access-Accept" },
    132  1.1.1.10  christos     { RADCMD_ACCESS_REJ,  "Access-Reject" },
    133  1.1.1.10  christos     { RADCMD_ACCOUNT_REQ, "Accounting-Request" },
    134  1.1.1.10  christos     { RADCMD_ACCOUNT_RES, "Accounting-Response" },
    135  1.1.1.10  christos     { RADCMD_ACCESS_CHA,  "Access-Challenge" },
    136  1.1.1.10  christos     { RADCMD_STATUS_SER,  "Status-Server" },
    137  1.1.1.10  christos     { RADCMD_STATUS_CLI,  "Status-Client" },
    138  1.1.1.10  christos     { RADCMD_DISCON_REQ,  "Disconnect-Request" },
    139  1.1.1.10  christos     { RADCMD_DISCON_ACK,  "Disconnect-ACK" },
    140  1.1.1.10  christos     { RADCMD_DISCON_NAK,  "Disconnect-NAK" },
    141  1.1.1.10  christos     { RADCMD_COA_REQ,     "CoA-Request" },
    142  1.1.1.10  christos     { RADCMD_COA_ACK,     "CoA-ACK" },
    143  1.1.1.10  christos     { RADCMD_COA_NAK,     "CoA-NAK" },
    144  1.1.1.10  christos     { RADCMD_RESERVED,    "Reserved" },
    145       1.1  christos     { 0, NULL}
    146       1.1  christos };
    147       1.1  christos 
    148       1.1  christos /********************************/
    149       1.1  christos /* Begin Radius Attribute types */
    150       1.1  christos /********************************/
    151       1.1  christos #define SERV_TYPE    6
    152       1.1  christos #define FRM_IPADDR   8
    153       1.1  christos #define LOG_IPHOST  14
    154       1.1  christos #define LOG_SERVICE 15
    155       1.1  christos #define FRM_IPX     23
    156       1.1  christos #define SESSION_TIMEOUT   27
    157       1.1  christos #define IDLE_TIMEOUT      28
    158       1.1  christos #define FRM_ATALK_LINK    37
    159       1.1  christos #define FRM_ATALK_NETWORK 38
    160       1.1  christos 
    161       1.1  christos #define ACCT_DELAY        41
    162       1.1  christos #define ACCT_SESSION_TIME 46
    163       1.1  christos 
    164   1.1.1.5  christos #define EGRESS_VLAN_ID   56
    165   1.1.1.5  christos #define EGRESS_VLAN_NAME 58
    166   1.1.1.5  christos 
    167       1.1  christos #define TUNNEL_TYPE        64
    168       1.1  christos #define TUNNEL_MEDIUM      65
    169       1.1  christos #define TUNNEL_CLIENT_END  66
    170       1.1  christos #define TUNNEL_SERVER_END  67
    171       1.1  christos #define TUNNEL_PASS        69
    172       1.1  christos 
    173       1.1  christos #define ARAP_PASS          70
    174       1.1  christos #define ARAP_FEATURES      71
    175       1.1  christos 
    176   1.1.1.9  christos #define EAP_MESSAGE        79
    177   1.1.1.9  christos 
    178       1.1  christos #define TUNNEL_PRIV_GROUP  81
    179       1.1  christos #define TUNNEL_ASSIGN_ID   82
    180       1.1  christos #define TUNNEL_PREFERENCE  83
    181       1.1  christos 
    182       1.1  christos #define ARAP_CHALLENGE_RESP 84
    183       1.1  christos #define ACCT_INT_INTERVAL   85
    184       1.1  christos 
    185       1.1  christos #define TUNNEL_CLIENT_AUTH 90
    186       1.1  christos #define TUNNEL_SERVER_AUTH 91
    187   1.1.1.9  christos 
    188   1.1.1.9  christos #define ERROR_CAUSE 101
    189       1.1  christos /********************************/
    190       1.1  christos /* End Radius Attribute types */
    191       1.1  christos /********************************/
    192       1.1  christos 
    193   1.1.1.5  christos #define RFC4675_TAGGED   0x31
    194   1.1.1.5  christos #define RFC4675_UNTAGGED 0x32
    195   1.1.1.5  christos 
    196   1.1.1.5  christos static const struct tok rfc4675_tagged[] = {
    197   1.1.1.5  christos     { RFC4675_TAGGED,   "Tagged" },
    198   1.1.1.5  christos     { RFC4675_UNTAGGED, "Untagged" },
    199   1.1.1.5  christos     { 0, NULL}
    200   1.1.1.5  christos };
    201   1.1.1.5  christos 
    202       1.1  christos 
    203   1.1.1.9  christos static void print_attr_string(netdissect_options *, const u_char *, u_int, u_short );
    204   1.1.1.9  christos static void print_attr_num(netdissect_options *, const u_char *, u_int, u_short );
    205   1.1.1.9  christos static void print_vendor_attr(netdissect_options *, const u_char *, u_int, u_short );
    206   1.1.1.9  christos static void print_attr_address(netdissect_options *, const u_char *, u_int, u_short);
    207   1.1.1.9  christos static void print_attr_address6(netdissect_options *, const u_char *, u_int, u_short);
    208   1.1.1.9  christos static void print_attr_netmask6(netdissect_options *, const u_char *, u_int, u_short);
    209   1.1.1.9  christos static void print_attr_mip6_home_link_prefix(netdissect_options *, const u_char *, u_int, u_short);
    210   1.1.1.9  christos static void print_attr_operator_name(netdissect_options *, const u_char *, u_int, u_short);
    211   1.1.1.9  christos static void print_attr_location_information(netdissect_options *, const u_char *, u_int, u_short);
    212   1.1.1.9  christos static void print_attr_location_data(netdissect_options *, const u_char *, u_int, u_short);
    213   1.1.1.9  christos static void print_basic_location_policy_rules(netdissect_options *, const u_char *, u_int, u_short);
    214   1.1.1.9  christos static void print_attr_time(netdissect_options *, const u_char *, u_int, u_short);
    215  1.1.1.10  christos static void print_attr_vector64(netdissect_options *, const u_char *, u_int, u_short);
    216   1.1.1.9  christos static void print_attr_strange(netdissect_options *, const u_char *, u_int, u_short);
    217   1.1.1.9  christos 
    218   1.1.1.9  christos 
    219   1.1.1.9  christos struct radius_hdr { nd_uint8_t  code;     /* Radius packet code  */
    220   1.1.1.9  christos                     nd_uint8_t  id;       /* Radius packet id    */
    221   1.1.1.9  christos                     nd_uint16_t len;      /* Radius total length */
    222   1.1.1.9  christos                     nd_byte     auth[16]; /* Authenticator   */
    223       1.1  christos                   };
    224       1.1  christos 
    225       1.1  christos #define MIN_RADIUS_LEN	20
    226       1.1  christos 
    227   1.1.1.9  christos struct radius_attr { nd_uint8_t type; /* Attribute type   */
    228   1.1.1.9  christos                      nd_uint8_t len;  /* Attribute length */
    229       1.1  christos                    };
    230       1.1  christos 
    231       1.1  christos 
    232       1.1  christos /* Service-Type Attribute standard values */
    233   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-4 */
    234       1.1  christos static const char *serv_type[]={ NULL,
    235       1.1  christos                                 "Login",
    236       1.1  christos                                 "Framed",
    237       1.1  christos                                 "Callback Login",
    238       1.1  christos                                 "Callback Framed",
    239       1.1  christos                                 "Outbound",
    240       1.1  christos                                 "Administrative",
    241       1.1  christos                                 "NAS Prompt",
    242       1.1  christos                                 "Authenticate Only",
    243       1.1  christos                                 "Callback NAS Prompt",
    244   1.1.1.9  christos                                 /* ^ [0, 9] ^ */
    245       1.1  christos                                 "Call Check",
    246       1.1  christos                                 "Callback Administrative",
    247   1.1.1.9  christos                                 "Voice",
    248   1.1.1.9  christos                                 "Fax",
    249   1.1.1.9  christos                                 "Modem Relay",
    250   1.1.1.9  christos                                 "IAPP-Register",
    251   1.1.1.9  christos                                 "IAPP-AP-Check",
    252   1.1.1.9  christos                                 "Authorize Only",
    253   1.1.1.9  christos                                 "Framed-Management",
    254   1.1.1.9  christos                                 "Additional-Authorization",
    255   1.1.1.9  christos                                 /* ^ [10, 19] ^ */
    256       1.1  christos                                };
    257       1.1  christos 
    258       1.1  christos /* Framed-Protocol Attribute standard values */
    259   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-5 */
    260       1.1  christos static const char *frm_proto[]={ NULL,
    261       1.1  christos                                  "PPP",
    262       1.1  christos                                  "SLIP",
    263       1.1  christos                                  "ARAP",
    264       1.1  christos                                  "Gandalf proprietary",
    265       1.1  christos                                  "Xylogics IPX/SLIP",
    266       1.1  christos                                  "X.75 Synchronous",
    267   1.1.1.9  christos                                  "GPRS PDP Context",
    268       1.1  christos                                };
    269       1.1  christos 
    270       1.1  christos /* Framed-Routing Attribute standard values */
    271   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-6 */
    272       1.1  christos static const char *frm_routing[]={ "None",
    273       1.1  christos                                    "Send",
    274       1.1  christos                                    "Listen",
    275       1.1  christos                                    "Send&Listen",
    276       1.1  christos                                  };
    277       1.1  christos 
    278       1.1  christos /* Framed-Compression Attribute standard values */
    279   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-7 */
    280       1.1  christos static const char *frm_comp[]={ "None",
    281       1.1  christos                                 "VJ TCP/IP",
    282       1.1  christos                                 "IPX",
    283       1.1  christos                                 "Stac-LZS",
    284       1.1  christos                               };
    285       1.1  christos 
    286       1.1  christos /* Login-Service Attribute standard values */
    287   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-8 */
    288       1.1  christos static const char *login_serv[]={ "Telnet",
    289       1.1  christos                                   "Rlogin",
    290       1.1  christos                                   "TCP Clear",
    291       1.1  christos                                   "PortMaster(proprietary)",
    292       1.1  christos                                   "LAT",
    293       1.1  christos                                   "X.25-PAD",
    294       1.1  christos                                   "X.25-T3POS",
    295       1.1  christos                                   "Unassigned",
    296       1.1  christos                                   "TCP Clear Quiet",
    297       1.1  christos                                 };
    298       1.1  christos 
    299       1.1  christos 
    300       1.1  christos /* Termination-Action Attribute standard values */
    301   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-9 */
    302       1.1  christos static const char *term_action[]={ "Default",
    303       1.1  christos                                    "RADIUS-Request",
    304       1.1  christos                                  };
    305       1.1  christos 
    306   1.1.1.5  christos /* Ingress-Filters Attribute standard values */
    307   1.1.1.5  christos static const char *ingress_filters[]={ NULL,
    308   1.1.1.5  christos                                        "Enabled",
    309   1.1.1.5  christos                                        "Disabled",
    310   1.1.1.5  christos                                      };
    311   1.1.1.5  christos 
    312       1.1  christos /* NAS-Port-Type Attribute standard values */
    313   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-13 */
    314       1.1  christos static const char *nas_port_type[]={ "Async",
    315       1.1  christos                                      "Sync",
    316       1.1  christos                                      "ISDN Sync",
    317       1.1  christos                                      "ISDN Async V.120",
    318       1.1  christos                                      "ISDN Async V.110",
    319       1.1  christos                                      "Virtual",
    320       1.1  christos                                      "PIAFS",
    321       1.1  christos                                      "HDLC Clear Channel",
    322       1.1  christos                                      "X.25",
    323       1.1  christos                                      "X.75",
    324   1.1.1.9  christos                                      /* ^ [0, 9] ^ */
    325       1.1  christos                                      "G.3 Fax",
    326       1.1  christos                                      "SDSL",
    327       1.1  christos                                      "ADSL-CAP",
    328       1.1  christos                                      "ADSL-DMT",
    329       1.1  christos                                      "ISDN-DSL",
    330       1.1  christos                                      "Ethernet",
    331       1.1  christos                                      "xDSL",
    332       1.1  christos                                      "Cable",
    333       1.1  christos                                      "Wireless - Other",
    334       1.1  christos                                      "Wireless - IEEE 802.11",
    335   1.1.1.9  christos                                      /* ^ [10, 19] ^ */
    336   1.1.1.9  christos                                      "Token-Ring",
    337   1.1.1.9  christos                                      "FDDI",
    338   1.1.1.9  christos                                      "Wireless - CDMA200",
    339   1.1.1.9  christos                                      "Wireless - UMTS",
    340   1.1.1.9  christos                                      "Wireless - 1X-EV",
    341   1.1.1.9  christos                                      "IAPP",
    342   1.1.1.9  christos                                      "FTTP",
    343   1.1.1.9  christos                                      "Wireless - IEEE 802.16",
    344   1.1.1.9  christos                                      "Wireless - IEEE 802.20",
    345   1.1.1.9  christos                                      "Wireless - IEEE 802.22",
    346   1.1.1.9  christos                                      /* ^ [20, 29] ^ */
    347   1.1.1.9  christos                                      "PPPoA",
    348   1.1.1.9  christos                                      "PPPoEoA",
    349   1.1.1.9  christos                                      "PPPoEoE",
    350   1.1.1.9  christos                                      "PPPoEoVLAN",
    351   1.1.1.9  christos                                      "PPPoEoQinQ",
    352   1.1.1.9  christos                                      "xPON",
    353   1.1.1.9  christos                                      "Wireless - XGP",
    354   1.1.1.9  christos                                      "WiMAX Pre-Release 8 IWK Function",
    355   1.1.1.9  christos                                      "WIMAX-WIFI-IWK",
    356   1.1.1.9  christos                                      "WIMAX-SFF",
    357   1.1.1.9  christos                                      /* ^ [30, 39] ^ */
    358   1.1.1.9  christos                                      "WIMAX-HA-LMA",
    359   1.1.1.9  christos                                      "WIMAX-DHCP",
    360   1.1.1.9  christos                                      "WIMAX-LBS",
    361   1.1.1.9  christos                                      "WIMAX-WVS",
    362       1.1  christos                                    };
    363       1.1  christos 
    364       1.1  christos /* Acct-Status-Type Accounting Attribute standard values */
    365   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-10 */
    366       1.1  christos static const char *acct_status[]={ NULL,
    367       1.1  christos                                    "Start",
    368       1.1  christos                                    "Stop",
    369       1.1  christos                                    "Interim-Update",
    370       1.1  christos                                    "Unassigned",
    371       1.1  christos                                    "Unassigned",
    372       1.1  christos                                    "Unassigned",
    373       1.1  christos                                    "Accounting-On",
    374       1.1  christos                                    "Accounting-Off",
    375       1.1  christos                                    "Tunnel-Start",
    376   1.1.1.9  christos                                      /* ^ [0, 9] ^ */
    377       1.1  christos                                    "Tunnel-Stop",
    378       1.1  christos                                    "Tunnel-Reject",
    379       1.1  christos                                    "Tunnel-Link-Start",
    380       1.1  christos                                    "Tunnel-Link-Stop",
    381       1.1  christos                                    "Tunnel-Link-Reject",
    382       1.1  christos                                    "Failed",
    383       1.1  christos                                  };
    384       1.1  christos 
    385       1.1  christos /* Acct-Authentic Accounting Attribute standard values */
    386   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-11 */
    387       1.1  christos static const char *acct_auth[]={ NULL,
    388       1.1  christos                                  "RADIUS",
    389       1.1  christos                                  "Local",
    390       1.1  christos                                  "Remote",
    391   1.1.1.9  christos                                  "Diameter",
    392       1.1  christos                                };
    393       1.1  christos 
    394       1.1  christos /* Acct-Terminate-Cause Accounting Attribute standard values */
    395   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-12 */
    396       1.1  christos static const char *acct_term[]={ NULL,
    397       1.1  christos                                  "User Request",
    398       1.1  christos                                  "Lost Carrier",
    399       1.1  christos                                  "Lost Service",
    400       1.1  christos                                  "Idle Timeout",
    401       1.1  christos                                  "Session Timeout",
    402       1.1  christos                                  "Admin Reset",
    403       1.1  christos                                  "Admin Reboot",
    404       1.1  christos                                  "Port Error",
    405       1.1  christos                                  "NAS Error",
    406   1.1.1.9  christos                                  /* ^ [0, 9] ^ */
    407       1.1  christos                                  "NAS Request",
    408       1.1  christos                                  "NAS Reboot",
    409       1.1  christos                                  "Port Unneeded",
    410       1.1  christos                                  "Port Preempted",
    411       1.1  christos                                  "Port Suspended",
    412       1.1  christos                                  "Service Unavailable",
    413       1.1  christos                                  "Callback",
    414       1.1  christos                                  "User Error",
    415       1.1  christos                                  "Host Request",
    416   1.1.1.9  christos                                  "Supplicant Restart",
    417   1.1.1.9  christos                                  /* ^ [10, 19] ^ */
    418   1.1.1.9  christos                                  "Reauthentication Failure",
    419   1.1.1.9  christos                                  "Port Reinitialized",
    420   1.1.1.9  christos                                  "Port Administratively Disabled",
    421   1.1.1.9  christos                                  "Lost Power",
    422       1.1  christos                                };
    423       1.1  christos 
    424       1.1  christos /* Tunnel-Type Attribute standard values */
    425   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-14 */
    426       1.1  christos static const char *tunnel_type[]={ NULL,
    427       1.1  christos                                    "PPTP",
    428       1.1  christos                                    "L2F",
    429       1.1  christos                                    "L2TP",
    430       1.1  christos                                    "ATMP",
    431       1.1  christos                                    "VTP",
    432       1.1  christos                                    "AH",
    433       1.1  christos                                    "IP-IP",
    434       1.1  christos                                    "MIN-IP-IP",
    435       1.1  christos                                    "ESP",
    436   1.1.1.9  christos                                    /* ^ [0, 9] ^ */
    437       1.1  christos                                    "GRE",
    438       1.1  christos                                    "DVS",
    439       1.1  christos                                    "IP-in-IP Tunneling",
    440   1.1.1.6  christos                                    "VLAN",
    441       1.1  christos                                  };
    442       1.1  christos 
    443       1.1  christos /* Tunnel-Medium-Type Attribute standard values */
    444   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-15 */
    445       1.1  christos static const char *tunnel_medium[]={ NULL,
    446       1.1  christos                                      "IPv4",
    447       1.1  christos                                      "IPv6",
    448       1.1  christos                                      "NSAP",
    449       1.1  christos                                      "HDLC",
    450       1.1  christos                                      "BBN 1822",
    451       1.1  christos                                      "802",
    452       1.1  christos                                      "E.163",
    453       1.1  christos                                      "E.164",
    454       1.1  christos                                      "F.69",
    455   1.1.1.9  christos                                      /* ^ [0, 9] ^ */
    456       1.1  christos                                      "X.121",
    457       1.1  christos                                      "IPX",
    458       1.1  christos                                      "Appletalk",
    459       1.1  christos                                      "Decnet IV",
    460       1.1  christos                                      "Banyan Vines",
    461       1.1  christos                                      "E.164 with NSAP subaddress",
    462       1.1  christos                                    };
    463       1.1  christos 
    464       1.1  christos /* ARAP-Zone-Access Attribute standard values */
    465   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-16 */
    466       1.1  christos static const char *arap_zone[]={ NULL,
    467       1.1  christos                                  "Only access to dfl zone",
    468       1.1  christos                                  "Use zone filter inc.",
    469       1.1  christos                                  "Not used",
    470       1.1  christos                                  "Use zone filter exc.",
    471       1.1  christos                                };
    472       1.1  christos 
    473   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-17 */
    474       1.1  christos static const char *prompt[]={ "No Echo",
    475       1.1  christos                               "Echo",
    476       1.1  christos                             };
    477       1.1  christos 
    478   1.1.1.9  christos /* Error-Cause standard values */
    479   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-18 */
    480   1.1.1.9  christos #define ERROR_CAUSE_RESIDUAL_CONTEXT_REMOVED 201
    481   1.1.1.9  christos #define ERROR_CAUSE_INVALID_EAP_PACKET 202
    482   1.1.1.9  christos #define ERROR_CAUSE_UNSUPPORTED_ATTRIBUTE 401
    483   1.1.1.9  christos #define ERROR_CAUSE_MISSING_ATTRIBUTE 402
    484   1.1.1.9  christos #define ERROR_CAUSE_NAS_IDENTIFICATION_MISMATCH 403
    485   1.1.1.9  christos #define ERROR_CAUSE_INVALID_REQUEST 404
    486   1.1.1.9  christos #define ERROR_CAUSE_UNSUPPORTED_SERVICE 405
    487   1.1.1.9  christos #define ERROR_CAUSE_UNSUPPORTED_EXTENSION 406
    488   1.1.1.9  christos #define ERROR_CAUSE_INVALID_ATTRIBUTE_VALUE 407
    489   1.1.1.9  christos #define ERROR_CAUSE_ADMINISTRATIVELY_PROHIBITED 501
    490   1.1.1.9  christos #define ERROR_CAUSE_PROXY_REQUEST_NOT_ROUTABLE 502
    491   1.1.1.9  christos #define ERROR_CAUSE_SESSION_CONTEXT_NOT_FOUND 503
    492   1.1.1.9  christos #define ERROR_CAUSE_SESSION_CONTEXT_NOT_REMOVABLE 504
    493   1.1.1.9  christos #define ERROR_CAUSE_PROXY_PROCESSING_ERROR 505
    494   1.1.1.9  christos #define ERROR_CAUSE_RESOURCES_UNAVAILABLE 506
    495   1.1.1.9  christos #define ERROR_CAUSE_REQUEST_INITIATED 507
    496   1.1.1.9  christos #define ERROR_CAUSE_MULTIPLE_SESSION_SELECTION_UNSUPPORTED 508
    497   1.1.1.9  christos #define ERROR_CAUSE_LOCATION_INFO_REQUIRED 509
    498   1.1.1.9  christos static const struct tok errorcausetype[] = {
    499   1.1.1.9  christos                                  { ERROR_CAUSE_RESIDUAL_CONTEXT_REMOVED,               "Residual Session Context Removed" },
    500   1.1.1.9  christos                                  { ERROR_CAUSE_INVALID_EAP_PACKET,                     "Invalid EAP Packet (Ignored)" },
    501   1.1.1.9  christos                                  { ERROR_CAUSE_UNSUPPORTED_ATTRIBUTE,                  "Unsupported Attribute" },
    502   1.1.1.9  christos                                  { ERROR_CAUSE_MISSING_ATTRIBUTE,                      "Missing Attribute" },
    503   1.1.1.9  christos                                  { ERROR_CAUSE_NAS_IDENTIFICATION_MISMATCH,            "NAS Identification Mismatch" },
    504   1.1.1.9  christos                                  { ERROR_CAUSE_INVALID_REQUEST,                        "Invalid Request" },
    505   1.1.1.9  christos                                  { ERROR_CAUSE_UNSUPPORTED_SERVICE,                    "Unsupported Service" },
    506   1.1.1.9  christos                                  { ERROR_CAUSE_UNSUPPORTED_EXTENSION,                  "Unsupported Extension" },
    507   1.1.1.9  christos                                  { ERROR_CAUSE_INVALID_ATTRIBUTE_VALUE,                "Invalid Attribute Value" },
    508   1.1.1.9  christos                                  { ERROR_CAUSE_ADMINISTRATIVELY_PROHIBITED,            "Administratively Prohibited" },
    509   1.1.1.9  christos                                  { ERROR_CAUSE_PROXY_REQUEST_NOT_ROUTABLE,             "Request Not Routable (Proxy)" },
    510   1.1.1.9  christos                                  { ERROR_CAUSE_SESSION_CONTEXT_NOT_FOUND,              "Session Context Not Found" },
    511   1.1.1.9  christos                                  { ERROR_CAUSE_SESSION_CONTEXT_NOT_REMOVABLE,          "Session Context Not Removable" },
    512   1.1.1.9  christos                                  { ERROR_CAUSE_PROXY_PROCESSING_ERROR,                 "Other Proxy Processing Error" },
    513   1.1.1.9  christos                                  { ERROR_CAUSE_RESOURCES_UNAVAILABLE,                  "Resources Unavailable" },
    514   1.1.1.9  christos                                  { ERROR_CAUSE_REQUEST_INITIATED,                      "Request Initiated" },
    515   1.1.1.9  christos                                  { ERROR_CAUSE_MULTIPLE_SESSION_SELECTION_UNSUPPORTED, "Multiple Session Selection Unsupported" },
    516   1.1.1.9  christos                                  { ERROR_CAUSE_LOCATION_INFO_REQUIRED,                 "Location Info Required" },
    517   1.1.1.9  christos 																 { 0, NULL }
    518   1.1.1.9  christos                                };
    519   1.1.1.9  christos 
    520   1.1.1.9  christos /* MIP6-Feature-Vector standard values */
    521   1.1.1.9  christos /* https://www.iana.org/assignments/aaa-parameters/aaa-parameters.xhtml */
    522   1.1.1.9  christos #define MIP6_INTEGRATED 0x0000000000000001
    523   1.1.1.9  christos #define LOCAL_HOME_AGENT_ASSIGNMENT 0x0000000000000002
    524   1.1.1.9  christos #define PMIP6_SUPPORTED 0x0000010000000000
    525   1.1.1.9  christos #define IP4_HOA_SUPPORTED 0x0000020000000000
    526   1.1.1.9  christos #define LOCAL_MAG_ROUTING_SUPPORTED 0x0000040000000000
    527   1.1.1.9  christos #define ASSIGN_LOCAL_IP 0x0000080000000000
    528   1.1.1.9  christos #define MIP4_SUPPORTED 0x0000100000000000
    529   1.1.1.9  christos #define OPTIMIZED_IDLE_MODE_MOBILITY 0x0000200000000000
    530   1.1.1.9  christos #define GTPv2_SUPPORTED 0x0000400000000000
    531   1.1.1.9  christos #define IP4_TRANSPORT_SUPPORTED 0x0000800000000000
    532   1.1.1.9  christos #define IP4_HOA_ONLY_SUPPORTED 0x0001000000000000
    533   1.1.1.9  christos #define INTER_MAG_ROUTING_SUPPORTED 0x0002000000000000
    534   1.1.1.9  christos static const struct mip6_feature_vector {
    535   1.1.1.9  christos                   uint64_t v;
    536   1.1.1.9  christos                   const char *s;
    537   1.1.1.9  christos                 } mip6_feature_vector[] = {
    538   1.1.1.9  christos                                  { MIP6_INTEGRATED,             "MIP6_INTEGRATED" },
    539   1.1.1.9  christos                                  { LOCAL_HOME_AGENT_ASSIGNMENT, "LOCAL_HOME_AGENT_ASSIGNMENT" },
    540   1.1.1.9  christos                                  { PMIP6_SUPPORTED,             "PMIP6_SUPPORTED" },
    541   1.1.1.9  christos                                  { IP4_HOA_SUPPORTED,           "IP4_HOA_SUPPORTED" },
    542   1.1.1.9  christos                                  { LOCAL_MAG_ROUTING_SUPPORTED, "LOCAL_MAG_ROUTING_SUPPORTED" },
    543   1.1.1.9  christos                                  { ASSIGN_LOCAL_IP,             "ASSIGN_LOCAL_IP" },
    544   1.1.1.9  christos                                  { MIP4_SUPPORTED,              "MIP4_SUPPORTED" },
    545   1.1.1.9  christos                                  { OPTIMIZED_IDLE_MODE_MOBILITY, "OPTIMIZED_IDLE_MODE_MOBILITY" },
    546   1.1.1.9  christos                                  { GTPv2_SUPPORTED,             "GTPv2_SUPPORTED" },
    547   1.1.1.9  christos                                  { IP4_TRANSPORT_SUPPORTED,     "IP4_TRANSPORT_SUPPORTED" },
    548   1.1.1.9  christos                                  { IP4_HOA_ONLY_SUPPORTED,      "IP4_HOA_ONLY_SUPPORTED" },
    549   1.1.1.9  christos                                  { INTER_MAG_ROUTING_SUPPORTED, "INTER_MAG_ROUTING_SUPPORTED" },
    550   1.1.1.9  christos                                };
    551       1.1  christos 
    552   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-19 */
    553   1.1.1.9  christos #define OPERATOR_NAME_TADIG 0x30
    554   1.1.1.9  christos #define OPERATOR_NAME_REALM 0x31
    555   1.1.1.9  christos #define OPERATOR_NAME_E212  0x32
    556   1.1.1.9  christos #define OPERATOR_NAME_ICC   0x33
    557   1.1.1.9  christos static const struct tok operator_name_vector[] = {
    558   1.1.1.9  christos                                  { OPERATOR_NAME_TADIG, "TADIG" },
    559   1.1.1.9  christos                                  { OPERATOR_NAME_REALM, "REALM" },
    560   1.1.1.9  christos                                  { OPERATOR_NAME_E212,  "E212"  },
    561   1.1.1.9  christos                                  { OPERATOR_NAME_ICC,   "ICC"   },
    562   1.1.1.9  christos                                  { 0, NULL }
    563   1.1.1.9  christos                                };
    564   1.1.1.9  christos 
    565   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-20 */
    566   1.1.1.9  christos #define LOCATION_INFORMATION_CODE_CIVIC      0
    567   1.1.1.9  christos #define LOCATION_INFORMATION_CODE_GEOSPATIAL 1
    568   1.1.1.9  christos static const struct tok location_information_code_vector[] = {
    569   1.1.1.9  christos                                  { LOCATION_INFORMATION_CODE_CIVIC     , "Civic"      },
    570   1.1.1.9  christos                                  { LOCATION_INFORMATION_CODE_GEOSPATIAL, "Geospatial" },
    571   1.1.1.9  christos                                  { 0, NULL }
    572   1.1.1.9  christos                                };
    573   1.1.1.9  christos 
    574   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-21 */
    575   1.1.1.9  christos #define LOCATION_INFORMATION_ENTITY_USER   0
    576   1.1.1.9  christos #define LOCATION_INFORMATION_ENTITY_RADIUS 1
    577   1.1.1.9  christos static const struct tok location_information_entity_vector[] = {
    578   1.1.1.9  christos                                  { LOCATION_INFORMATION_ENTITY_USER,   "User"   },
    579   1.1.1.9  christos                                  { LOCATION_INFORMATION_ENTITY_RADIUS, "RADIUS" },
    580   1.1.1.9  christos                                  { 0, NULL }
    581   1.1.1.9  christos                                };
    582   1.1.1.9  christos 
    583   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-22 */
    584   1.1.1.9  christos static const struct tok blpr_bm[] = {
    585   1.1.1.9  christos                                  { 0x0001, "MBZ-15" },
    586   1.1.1.9  christos                                  { 0x0002, "MBZ-14" },
    587   1.1.1.9  christos                                  { 0x0004, "MBZ-13" },
    588   1.1.1.9  christos                                  { 0x0008, "MBZ-12" },
    589   1.1.1.9  christos                                  { 0x0010, "MBZ-11" },
    590   1.1.1.9  christos                                  { 0x0020, "MBZ-10" },
    591   1.1.1.9  christos                                  { 0x0040, "MBZ-9" },
    592   1.1.1.9  christos                                  { 0x0080, "MBZ-8" },
    593   1.1.1.9  christos                                  { 0x0100, "MBZ-7" },
    594   1.1.1.9  christos                                  { 0x0200, "MBZ-6" },
    595   1.1.1.9  christos                                  { 0x0400, "MBZ-5" },
    596   1.1.1.9  christos                                  { 0x0800, "MBZ-4" },
    597   1.1.1.9  christos                                  { 0x1000, "MBZ-3" },
    598   1.1.1.9  christos                                  { 0x2000, "MBZ-2" },
    599   1.1.1.9  christos                                  { 0x4000, "MBZ-1" },
    600   1.1.1.9  christos                                  { 0x8000, "Retransmission Allowed" },
    601   1.1.1.9  christos                                  { 0, NULL }
    602   1.1.1.9  christos                                };
    603   1.1.1.9  christos 
    604   1.1.1.9  christos /* https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-2 */
    605   1.1.1.9  christos static const struct attrtype {
    606   1.1.1.7       spz                   const char *name;      /* Attribute name                 */
    607       1.1  christos                   const char **subtypes; /* Standard Values (if any)       */
    608       1.1  christos                   u_char siz_subtypes;   /* Size of total standard values  */
    609       1.1  christos                   u_char first_subtype;  /* First standard value is 0 or 1 */
    610   1.1.1.9  christos                   void (*print_func)(netdissect_options *, const u_char *, u_int, u_short);
    611       1.1  christos                 } attr_type[]=
    612       1.1  christos   {
    613       1.1  christos      { NULL,                              NULL, 0, 0, NULL               },
    614   1.1.1.5  christos      { "User-Name",                       NULL, 0, 0, print_attr_string  },
    615   1.1.1.5  christos      { "User-Password",                   NULL, 0, 0, NULL               },
    616   1.1.1.5  christos      { "CHAP-Password",                   NULL, 0, 0, NULL               },
    617   1.1.1.5  christos      { "NAS-IP-Address",                  NULL, 0, 0, print_attr_address },
    618   1.1.1.5  christos      { "NAS-Port",                        NULL, 0, 0, print_attr_num     },
    619   1.1.1.5  christos      { "Service-Type",                    serv_type, TAM_SIZE(serv_type)-1, 1, print_attr_num },
    620   1.1.1.5  christos      { "Framed-Protocol",                 frm_proto, TAM_SIZE(frm_proto)-1, 1, print_attr_num },
    621   1.1.1.5  christos      { "Framed-IP-Address",               NULL, 0, 0, print_attr_address },
    622   1.1.1.5  christos      { "Framed-IP-Netmask",               NULL, 0, 0, print_attr_address },
    623   1.1.1.9  christos      /* ^ [0, 9] ^ */
    624   1.1.1.5  christos      { "Framed-Routing",                  frm_routing, TAM_SIZE(frm_routing), 0, print_attr_num },
    625   1.1.1.5  christos      { "Filter-Id",                       NULL, 0, 0, print_attr_string  },
    626   1.1.1.5  christos      { "Framed-MTU",                      NULL, 0, 0, print_attr_num     },
    627   1.1.1.5  christos      { "Framed-Compression",              frm_comp, TAM_SIZE(frm_comp),   0, print_attr_num },
    628   1.1.1.5  christos      { "Login-IP-Host",                   NULL, 0, 0, print_attr_address },
    629   1.1.1.5  christos      { "Login-Service",                   login_serv, TAM_SIZE(login_serv), 0, print_attr_num },
    630   1.1.1.5  christos      { "Login-TCP-Port",                  NULL, 0, 0, print_attr_num     },
    631       1.1  christos      { "Unassigned",                      NULL, 0, 0, NULL }, /*17*/
    632   1.1.1.5  christos      { "Reply-Message",                   NULL, 0, 0, print_attr_string },
    633   1.1.1.5  christos      { "Callback-Number",                 NULL, 0, 0, print_attr_string },
    634   1.1.1.9  christos      /* ^ [10, 19] ^ */
    635   1.1.1.5  christos      { "Callback-Id",                     NULL, 0, 0, print_attr_string },
    636       1.1  christos      { "Unassigned",                      NULL, 0, 0, NULL }, /*21*/
    637   1.1.1.5  christos      { "Framed-Route",                    NULL, 0, 0, print_attr_string },
    638   1.1.1.5  christos      { "Framed-IPX-Network",              NULL, 0, 0, print_attr_num    },
    639       1.1  christos      { "State",                           NULL, 0, 0, print_attr_string },
    640       1.1  christos      { "Class",                           NULL, 0, 0, print_attr_string },
    641   1.1.1.5  christos      { "Vendor-Specific",                 NULL, 0, 0, print_vendor_attr },
    642   1.1.1.5  christos      { "Session-Timeout",                 NULL, 0, 0, print_attr_num    },
    643   1.1.1.5  christos      { "Idle-Timeout",                    NULL, 0, 0, print_attr_num    },
    644   1.1.1.5  christos      { "Termination-Action",              term_action, TAM_SIZE(term_action), 0, print_attr_num },
    645   1.1.1.9  christos      /* ^ [20, 29] ^ */
    646   1.1.1.5  christos      { "Called-Station-Id",               NULL, 0, 0, print_attr_string },
    647   1.1.1.5  christos      { "Calling-Station-Id",              NULL, 0, 0, print_attr_string },
    648   1.1.1.5  christos      { "NAS-Identifier",                  NULL, 0, 0, print_attr_string },
    649   1.1.1.5  christos      { "Proxy-State",                     NULL, 0, 0, print_attr_string },
    650   1.1.1.5  christos      { "Login-LAT-Service",               NULL, 0, 0, print_attr_string },
    651   1.1.1.5  christos      { "Login-LAT-Node",                  NULL, 0, 0, print_attr_string },
    652   1.1.1.5  christos      { "Login-LAT-Group",                 NULL, 0, 0, print_attr_string },
    653   1.1.1.5  christos      { "Framed-AppleTalk-Link",           NULL, 0, 0, print_attr_num    },
    654   1.1.1.5  christos      { "Framed-AppleTalk-Network",        NULL, 0, 0, print_attr_num    },
    655   1.1.1.5  christos      { "Framed-AppleTalk-Zone",           NULL, 0, 0, print_attr_string },
    656   1.1.1.9  christos      /* ^ [30, 39] ^ */
    657   1.1.1.5  christos      { "Acct-Status-Type",                acct_status, TAM_SIZE(acct_status)-1, 1, print_attr_num },
    658   1.1.1.5  christos      { "Acct-Delay-Time",                 NULL, 0, 0, print_attr_num    },
    659   1.1.1.5  christos      { "Acct-Input-Octets",               NULL, 0, 0, print_attr_num    },
    660   1.1.1.5  christos      { "Acct-Output-Octets",              NULL, 0, 0, print_attr_num    },
    661   1.1.1.5  christos      { "Acct-Session-Id",                 NULL, 0, 0, print_attr_string },
    662   1.1.1.5  christos      { "Acct-Authentic",                  acct_auth, TAM_SIZE(acct_auth)-1, 1, print_attr_num },
    663   1.1.1.5  christos      { "Acct-Session-Time",               NULL, 0, 0, print_attr_num },
    664   1.1.1.5  christos      { "Acct-Input-Packets",              NULL, 0, 0, print_attr_num },
    665   1.1.1.5  christos      { "Acct-Output-Packets",             NULL, 0, 0, print_attr_num },
    666   1.1.1.5  christos      { "Acct-Terminate-Cause",            acct_term, TAM_SIZE(acct_term)-1, 1, print_attr_num },
    667   1.1.1.9  christos      /* ^ [40, 49] ^ */
    668   1.1.1.5  christos      { "Acct-Multi-Session-Id",           NULL, 0, 0, print_attr_string },
    669   1.1.1.5  christos      { "Acct-Link-Count",                 NULL, 0, 0, print_attr_num },
    670   1.1.1.5  christos      { "Acct-Input-Gigawords",            NULL, 0, 0, print_attr_num },
    671   1.1.1.5  christos      { "Acct-Output-Gigawords",           NULL, 0, 0, print_attr_num },
    672       1.1  christos      { "Unassigned",                      NULL, 0, 0, NULL }, /*54*/
    673   1.1.1.5  christos      { "Event-Timestamp",                 NULL, 0, 0, print_attr_time },
    674   1.1.1.5  christos      { "Egress-VLANID",                   NULL, 0, 0, print_attr_num },
    675   1.1.1.5  christos      { "Ingress-Filters",                 ingress_filters, TAM_SIZE(ingress_filters)-1, 1, print_attr_num },
    676   1.1.1.5  christos      { "Egress-VLAN-Name",                NULL, 0, 0, print_attr_string },
    677   1.1.1.5  christos      { "User-Priority-Table",             NULL, 0, 0, NULL },
    678   1.1.1.9  christos      /* ^ [50, 59] ^ */
    679   1.1.1.5  christos      { "CHAP-Challenge",                  NULL, 0, 0, print_attr_string },
    680   1.1.1.5  christos      { "NAS-Port-Type",                   nas_port_type, TAM_SIZE(nas_port_type), 0, print_attr_num },
    681   1.1.1.5  christos      { "Port-Limit",                      NULL, 0, 0, print_attr_num },
    682   1.1.1.5  christos      { "Login-LAT-Port",                  NULL, 0, 0, print_attr_string }, /*63*/
    683   1.1.1.5  christos      { "Tunnel-Type",                     tunnel_type, TAM_SIZE(tunnel_type)-1, 1, print_attr_num },
    684   1.1.1.5  christos      { "Tunnel-Medium-Type",              tunnel_medium, TAM_SIZE(tunnel_medium)-1, 1, print_attr_num },
    685   1.1.1.5  christos      { "Tunnel-Client-Endpoint",          NULL, 0, 0, print_attr_string },
    686   1.1.1.5  christos      { "Tunnel-Server-Endpoint",          NULL, 0, 0, print_attr_string },
    687   1.1.1.5  christos      { "Acct-Tunnel-Connection",          NULL, 0, 0, print_attr_string },
    688   1.1.1.5  christos      { "Tunnel-Password",                 NULL, 0, 0, print_attr_string  },
    689   1.1.1.9  christos      /* ^ [60, 69] ^ */
    690   1.1.1.5  christos      { "ARAP-Password",                   NULL, 0, 0, print_attr_strange },
    691   1.1.1.5  christos      { "ARAP-Features",                   NULL, 0, 0, print_attr_strange },
    692   1.1.1.5  christos      { "ARAP-Zone-Access",                arap_zone, TAM_SIZE(arap_zone)-1, 1, print_attr_num }, /*72*/
    693   1.1.1.5  christos      { "ARAP-Security",                   NULL, 0, 0, print_attr_string },
    694   1.1.1.5  christos      { "ARAP-Security-Data",              NULL, 0, 0, print_attr_string },
    695   1.1.1.5  christos      { "Password-Retry",                  NULL, 0, 0, print_attr_num    },
    696       1.1  christos      { "Prompt",                          prompt, TAM_SIZE(prompt), 0, print_attr_num },
    697   1.1.1.5  christos      { "Connect-Info",                    NULL, 0, 0, print_attr_string   },
    698   1.1.1.5  christos      { "Configuration-Token",             NULL, 0, 0, print_attr_string   },
    699   1.1.1.5  christos      { "EAP-Message",                     NULL, 0, 0, print_attr_string   },
    700   1.1.1.9  christos      /* ^ [70, 79] ^ */
    701   1.1.1.5  christos      { "Message-Authenticator",           NULL, 0, 0, print_attr_string }, /*80*/
    702   1.1.1.5  christos      { "Tunnel-Private-Group-ID",         NULL, 0, 0, print_attr_string },
    703   1.1.1.5  christos      { "Tunnel-Assignment-ID",            NULL, 0, 0, print_attr_string },
    704   1.1.1.5  christos      { "Tunnel-Preference",               NULL, 0, 0, print_attr_num    },
    705   1.1.1.5  christos      { "ARAP-Challenge-Response",         NULL, 0, 0, print_attr_strange },
    706   1.1.1.5  christos      { "Acct-Interim-Interval",           NULL, 0, 0, print_attr_num     },
    707   1.1.1.5  christos      { "Acct-Tunnel-Packets-Lost",        NULL, 0, 0, print_attr_num }, /*86*/
    708   1.1.1.5  christos      { "NAS-Port-Id",                     NULL, 0, 0, print_attr_string },
    709   1.1.1.5  christos      { "Framed-Pool",                     NULL, 0, 0, print_attr_string },
    710   1.1.1.5  christos      { "CUI",                             NULL, 0, 0, print_attr_string },
    711   1.1.1.9  christos      /* ^ [80, 89] ^ */
    712   1.1.1.5  christos      { "Tunnel-Client-Auth-ID",           NULL, 0, 0, print_attr_string },
    713   1.1.1.5  christos      { "Tunnel-Server-Auth-ID",           NULL, 0, 0, print_attr_string },
    714   1.1.1.9  christos      { "NAS-Filter-Rule",                 NULL, 0, 0, print_attr_string },
    715   1.1.1.9  christos      { "Unassigned",                      NULL, 0, 0, NULL },  /*93*/
    716   1.1.1.9  christos      { "Originating-Line-Info",           NULL, 0, 0, NULL },
    717   1.1.1.9  christos      { "NAS-IPv6-Address",                NULL, 0, 0, print_attr_address6 },
    718   1.1.1.9  christos      { "Framed-Interface-ID",             NULL, 0, 0, NULL },
    719   1.1.1.9  christos      { "Framed-IPv6-Prefix",              NULL, 0, 0, print_attr_netmask6 },
    720   1.1.1.9  christos      { "Login-IPv6-Host",                 NULL, 0, 0, print_attr_address6 },
    721   1.1.1.9  christos      { "Framed-IPv6-Route",               NULL, 0, 0, print_attr_string },
    722   1.1.1.9  christos      /* ^ [90, 99] ^ */
    723   1.1.1.9  christos      { "Framed-IPv6-Pool",                NULL, 0, 0, print_attr_string },
    724   1.1.1.9  christos      { "Error-Cause",                     NULL, 0, 0, print_attr_strange },
    725   1.1.1.9  christos      { "EAP-Key-Name",                    NULL, 0, 0, NULL },
    726   1.1.1.9  christos      { "Digest-Response",                 NULL, 0, 0, print_attr_string },
    727   1.1.1.9  christos      { "Digest-Realm",                    NULL, 0, 0, print_attr_string },
    728   1.1.1.9  christos      { "Digest-Nonce",                    NULL, 0, 0, print_attr_string },
    729   1.1.1.9  christos      { "Digest-Response-Auth",            NULL, 0, 0, print_attr_string },
    730   1.1.1.9  christos      { "Digest-Nextnonce",                NULL, 0, 0, print_attr_string },
    731   1.1.1.9  christos      { "Digest-Method",                   NULL, 0, 0, print_attr_string },
    732   1.1.1.9  christos      { "Digest-URI",                      NULL, 0, 0, print_attr_string },
    733   1.1.1.9  christos      /* ^ [100, 109] ^ */
    734   1.1.1.9  christos      { "Digest-Qop",                      NULL, 0, 0, print_attr_string },
    735   1.1.1.9  christos      { "Digest-Algorithm",                NULL, 0, 0, print_attr_string },
    736   1.1.1.9  christos      { "Digest-Entity-Body-Hash",         NULL, 0, 0, print_attr_string },
    737   1.1.1.9  christos      { "Digest-CNonce",                   NULL, 0, 0, print_attr_string },
    738   1.1.1.9  christos      { "Digest-Nonce-Count",              NULL, 0, 0, print_attr_string },
    739   1.1.1.9  christos      { "Digest-Username",                 NULL, 0, 0, print_attr_string },
    740   1.1.1.9  christos      { "Digest-Opaque",                   NULL, 0, 0, print_attr_string },
    741   1.1.1.9  christos      { "Digest-Auth-Param",               NULL, 0, 0, print_attr_string },
    742   1.1.1.9  christos      { "Digest-AKA-Auts",                 NULL, 0, 0, print_attr_string },
    743   1.1.1.9  christos      { "Digest-Domain",                   NULL, 0, 0, print_attr_string },
    744   1.1.1.9  christos      /* ^ [110, 119] ^ */
    745   1.1.1.9  christos      { "Digest-Stale",                    NULL, 0, 0, print_attr_string },
    746   1.1.1.9  christos      { "Digest-HA1",                      NULL, 0, 0, print_attr_string },
    747   1.1.1.9  christos      { "SIP-AOR",                         NULL, 0, 0, print_attr_string },
    748   1.1.1.9  christos      { "Delegated-IPv6-Prefix",           NULL, 0, 0, print_attr_netmask6 },
    749   1.1.1.9  christos      { "MIP6-Feature-Vector",             NULL, 0, 0, print_attr_vector64 },
    750   1.1.1.9  christos      { "MIP6-Home-Link-Prefix",           NULL, 0, 0, print_attr_mip6_home_link_prefix },
    751   1.1.1.9  christos      { "Operator-Name",                   NULL, 0, 0, print_attr_operator_name },
    752   1.1.1.9  christos      { "Location-Information",            NULL, 0, 0, print_attr_location_information },
    753   1.1.1.9  christos      { "Location-Data",                   NULL, 0, 0, print_attr_location_data },
    754   1.1.1.9  christos      { "Basic-Location-Policy-Rules",     NULL, 0, 0, print_basic_location_policy_rules }
    755   1.1.1.9  christos      /* ^ [120, 129] ^ */
    756       1.1  christos   };
    757       1.1  christos 
    758       1.1  christos 
    759       1.1  christos /*****************************/
    760       1.1  christos /* Print an attribute string */
    761       1.1  christos /* value pointed by 'data'   */
    762       1.1  christos /* and 'length' size.        */
    763       1.1  christos /*****************************/
    764       1.1  christos /* Returns nothing.          */
    765       1.1  christos /*****************************/
    766       1.1  christos static void
    767   1.1.1.4  christos print_attr_string(netdissect_options *ndo,
    768   1.1.1.9  christos                   const u_char *data, u_int length, u_short attr_code)
    769       1.1  christos {
    770   1.1.1.9  christos    u_int i;
    771       1.1  christos 
    772   1.1.1.9  christos    ND_TCHECK_LEN(data, length);
    773       1.1  christos 
    774  1.1.1.10  christos    switch(attr_code) {
    775       1.1  christos       case TUNNEL_PASS:
    776       1.1  christos            if (length < 3)
    777   1.1.1.8  christos               goto trunc;
    778   1.1.1.9  christos            if (GET_U_1(data) && (GET_U_1(data) <= 0x1F))
    779   1.1.1.9  christos               ND_PRINT("Tag[%u] ", GET_U_1(data));
    780   1.1.1.5  christos            else
    781   1.1.1.9  christos               ND_PRINT("Tag[Unused] ");
    782       1.1  christos            data++;
    783       1.1  christos            length--;
    784   1.1.1.9  christos            ND_PRINT("Salt %u ", GET_BE_U_2(data));
    785       1.1  christos            data+=2;
    786       1.1  christos            length-=2;
    787       1.1  christos         break;
    788       1.1  christos       case TUNNEL_CLIENT_END:
    789       1.1  christos       case TUNNEL_SERVER_END:
    790       1.1  christos       case TUNNEL_PRIV_GROUP:
    791       1.1  christos       case TUNNEL_ASSIGN_ID:
    792       1.1  christos       case TUNNEL_CLIENT_AUTH:
    793       1.1  christos       case TUNNEL_SERVER_AUTH:
    794  1.1.1.10  christos            if (GET_U_1(data) <= 0x1F) {
    795       1.1  christos               if (length < 1)
    796   1.1.1.8  christos                  goto trunc;
    797   1.1.1.9  christos               if (GET_U_1(data))
    798   1.1.1.9  christos                 ND_PRINT("Tag[%u] ", GET_U_1(data));
    799   1.1.1.5  christos               else
    800   1.1.1.9  christos                 ND_PRINT("Tag[Unused] ");
    801       1.1  christos               data++;
    802       1.1  christos               length--;
    803       1.1  christos            }
    804       1.1  christos         break;
    805   1.1.1.5  christos       case EGRESS_VLAN_NAME:
    806   1.1.1.8  christos            if (length < 1)
    807   1.1.1.8  christos               goto trunc;
    808   1.1.1.9  christos            ND_PRINT("%s (0x%02x) ",
    809   1.1.1.9  christos                   tok2str(rfc4675_tagged,"Unknown tag",GET_U_1(data)),
    810   1.1.1.9  christos                   GET_U_1(data));
    811   1.1.1.5  christos            data++;
    812   1.1.1.5  christos            length--;
    813   1.1.1.5  christos         break;
    814   1.1.1.9  christos       case EAP_MESSAGE:
    815   1.1.1.9  christos            if (length < 1)
    816   1.1.1.9  christos               goto trunc;
    817   1.1.1.9  christos            eap_print(ndo, data, length);
    818   1.1.1.9  christos            return;
    819       1.1  christos    }
    820       1.1  christos 
    821   1.1.1.9  christos    for (i=0; i < length && GET_U_1(data); i++, data++)
    822   1.1.1.9  christos        ND_PRINT("%c", ND_ASCII_ISPRINT(GET_U_1(data)) ? GET_U_1(data) : '.');
    823       1.1  christos 
    824       1.1  christos    return;
    825       1.1  christos 
    826       1.1  christos    trunc:
    827   1.1.1.9  christos       nd_print_trunc(ndo);
    828       1.1  christos }
    829       1.1  christos 
    830       1.1  christos /*
    831       1.1  christos  * print vendor specific attributes
    832       1.1  christos  */
    833       1.1  christos static void
    834   1.1.1.4  christos print_vendor_attr(netdissect_options *ndo,
    835   1.1.1.9  christos                   const u_char *data, u_int length, u_short attr_code _U_)
    836       1.1  christos {
    837       1.1  christos     u_int idx;
    838       1.1  christos     u_int vendor_id;
    839       1.1  christos     u_int vendor_type;
    840       1.1  christos     u_int vendor_length;
    841       1.1  christos 
    842       1.1  christos     if (length < 4)
    843       1.1  christos         goto trunc;
    844   1.1.1.9  christos     vendor_id = GET_BE_U_4(data);
    845       1.1  christos     data+=4;
    846       1.1  christos     length-=4;
    847       1.1  christos 
    848   1.1.1.9  christos     ND_PRINT("Vendor: %s (%u)",
    849       1.1  christos            tok2str(smi_values,"Unknown",vendor_id),
    850   1.1.1.9  christos            vendor_id);
    851       1.1  christos 
    852       1.1  christos     while (length >= 2) {
    853   1.1.1.9  christos         vendor_type = GET_U_1(data);
    854   1.1.1.9  christos         vendor_length = GET_U_1(data + 1);
    855       1.1  christos 
    856  1.1.1.10  christos         if (vendor_length < 2) {
    857   1.1.1.9  christos             ND_PRINT("\n\t    Vendor Attribute: %u, Length: %u (bogus, must be >= 2)",
    858       1.1  christos                    vendor_type,
    859   1.1.1.9  christos                    vendor_length);
    860       1.1  christos             return;
    861       1.1  christos         }
    862  1.1.1.10  christos         if (vendor_length > length) {
    863   1.1.1.9  christos             ND_PRINT("\n\t    Vendor Attribute: %u, Length: %u (bogus, goes past end of vendor-specific attribute)",
    864       1.1  christos                    vendor_type,
    865   1.1.1.9  christos                    vendor_length);
    866       1.1  christos             return;
    867       1.1  christos         }
    868       1.1  christos         data+=2;
    869       1.1  christos         vendor_length-=2;
    870       1.1  christos         length-=2;
    871   1.1.1.9  christos 	ND_TCHECK_LEN(data, vendor_length);
    872       1.1  christos 
    873   1.1.1.9  christos         ND_PRINT("\n\t    Vendor Attribute: %u, Length: %u, Value: ",
    874       1.1  christos                vendor_type,
    875   1.1.1.9  christos                vendor_length);
    876       1.1  christos         for (idx = 0; idx < vendor_length ; idx++, data++)
    877   1.1.1.9  christos             ND_PRINT("%c", ND_ASCII_ISPRINT(GET_U_1(data)) ? GET_U_1(data) : '.');
    878       1.1  christos         length-=vendor_length;
    879       1.1  christos     }
    880       1.1  christos     return;
    881       1.1  christos 
    882       1.1  christos    trunc:
    883   1.1.1.9  christos      nd_print_trunc(ndo);
    884       1.1  christos }
    885       1.1  christos 
    886       1.1  christos /******************************/
    887       1.1  christos /* Print an attribute numeric */
    888       1.1  christos /* value pointed by 'data'    */
    889       1.1  christos /* and 'length' size.         */
    890       1.1  christos /******************************/
    891       1.1  christos /* Returns nothing.           */
    892       1.1  christos /******************************/
    893       1.1  christos static void
    894   1.1.1.4  christos print_attr_num(netdissect_options *ndo,
    895   1.1.1.9  christos                const u_char *data, u_int length, u_short attr_code)
    896       1.1  christos {
    897   1.1.1.4  christos    uint32_t timeout;
    898       1.1  christos 
    899  1.1.1.10  christos    if (length != 4) {
    900   1.1.1.9  christos        ND_PRINT("ERROR: length %u != 4", length);
    901       1.1  christos        return;
    902       1.1  christos    }
    903       1.1  christos 
    904       1.1  christos                           /* This attribute has standard values */
    905  1.1.1.10  christos    if (attr_type[attr_code].siz_subtypes) {
    906       1.1  christos       static const char **table;
    907   1.1.1.4  christos       uint32_t data_value;
    908       1.1  christos       table = attr_type[attr_code].subtypes;
    909       1.1  christos 
    910  1.1.1.10  christos       if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) ) {
    911   1.1.1.9  christos          if (!GET_U_1(data))
    912   1.1.1.9  christos             ND_PRINT("Tag[Unused] ");
    913       1.1  christos          else
    914   1.1.1.9  christos             ND_PRINT("Tag[%u] ", GET_U_1(data));
    915       1.1  christos          data++;
    916   1.1.1.9  christos          data_value = GET_BE_U_3(data);
    917  1.1.1.10  christos       } else {
    918   1.1.1.9  christos          data_value = GET_BE_U_4(data);
    919       1.1  christos       }
    920   1.1.1.4  christos       if ( data_value <= (uint32_t)(attr_type[attr_code].siz_subtypes - 1 +
    921       1.1  christos             attr_type[attr_code].first_subtype) &&
    922       1.1  christos 	   data_value >= attr_type[attr_code].first_subtype )
    923   1.1.1.9  christos          ND_PRINT("%s", table[data_value]);
    924       1.1  christos       else
    925   1.1.1.9  christos          ND_PRINT("#%u", data_value);
    926  1.1.1.10  christos    } else {
    927       1.1  christos       switch(attr_code) /* Be aware of special cases... */
    928       1.1  christos       {
    929       1.1  christos         case FRM_IPX:
    930   1.1.1.9  christos              if (GET_BE_U_4(data) == 0xFFFFFFFE )
    931   1.1.1.9  christos                 ND_PRINT("NAS Select");
    932       1.1  christos              else
    933   1.1.1.9  christos                 ND_PRINT("%u", GET_BE_U_4(data));
    934       1.1  christos           break;
    935       1.1  christos 
    936       1.1  christos         case SESSION_TIMEOUT:
    937       1.1  christos         case IDLE_TIMEOUT:
    938       1.1  christos         case ACCT_DELAY:
    939       1.1  christos         case ACCT_SESSION_TIME:
    940       1.1  christos         case ACCT_INT_INTERVAL:
    941   1.1.1.9  christos              timeout = GET_BE_U_4(data);
    942       1.1  christos              if ( timeout < 60 )
    943   1.1.1.9  christos                 ND_PRINT("%02d secs", timeout);
    944  1.1.1.10  christos              else {
    945       1.1  christos                 if ( timeout < 3600 )
    946   1.1.1.9  christos                    ND_PRINT("%02d:%02d min",
    947   1.1.1.9  christos                           timeout / 60, timeout % 60);
    948       1.1  christos                 else
    949   1.1.1.9  christos                    ND_PRINT("%02d:%02d:%02d hours",
    950       1.1  christos                           timeout / 3600, (timeout % 3600) / 60,
    951   1.1.1.9  christos                           timeout % 60);
    952       1.1  christos              }
    953       1.1  christos           break;
    954       1.1  christos 
    955       1.1  christos         case FRM_ATALK_LINK:
    956   1.1.1.9  christos              if (GET_BE_U_4(data))
    957   1.1.1.9  christos                 ND_PRINT("%u", GET_BE_U_4(data));
    958       1.1  christos              else
    959   1.1.1.9  christos                 ND_PRINT("Unnumbered");
    960       1.1  christos           break;
    961       1.1  christos 
    962       1.1  christos         case FRM_ATALK_NETWORK:
    963   1.1.1.9  christos              if (GET_BE_U_4(data))
    964   1.1.1.9  christos                 ND_PRINT("%u", GET_BE_U_4(data));
    965       1.1  christos              else
    966   1.1.1.9  christos                 ND_PRINT("NAS assigned");
    967       1.1  christos           break;
    968       1.1  christos 
    969       1.1  christos         case TUNNEL_PREFERENCE:
    970   1.1.1.9  christos             if (GET_U_1(data))
    971   1.1.1.9  christos                ND_PRINT("Tag[%u] ", GET_U_1(data));
    972       1.1  christos             else
    973   1.1.1.9  christos                ND_PRINT("Tag[Unused] ");
    974   1.1.1.5  christos             data++;
    975   1.1.1.9  christos             ND_PRINT("%u", GET_BE_U_3(data));
    976   1.1.1.5  christos           break;
    977   1.1.1.5  christos 
    978   1.1.1.5  christos         case EGRESS_VLAN_ID:
    979   1.1.1.9  christos             ND_PRINT("%s (0x%02x) ",
    980   1.1.1.9  christos                    tok2str(rfc4675_tagged,"Unknown tag",GET_U_1(data)),
    981   1.1.1.9  christos                    GET_U_1(data));
    982   1.1.1.5  christos             data++;
    983   1.1.1.9  christos             ND_PRINT("%u", GET_BE_U_3(data));
    984       1.1  christos           break;
    985       1.1  christos 
    986       1.1  christos         default:
    987   1.1.1.9  christos              ND_PRINT("%u", GET_BE_U_4(data));
    988       1.1  christos           break;
    989       1.1  christos 
    990       1.1  christos       } /* switch */
    991       1.1  christos 
    992       1.1  christos    } /* if-else */
    993       1.1  christos }
    994       1.1  christos 
    995       1.1  christos /*****************************/
    996       1.1  christos /* Print an attribute IPv4   */
    997       1.1  christos /* address value pointed by  */
    998       1.1  christos /* 'data' and 'length' size. */
    999       1.1  christos /*****************************/
   1000       1.1  christos /* Returns nothing.          */
   1001       1.1  christos /*****************************/
   1002       1.1  christos static void
   1003   1.1.1.4  christos print_attr_address(netdissect_options *ndo,
   1004   1.1.1.9  christos                    const u_char *data, u_int length, u_short attr_code)
   1005       1.1  christos {
   1006  1.1.1.10  christos    if (length != 4) {
   1007   1.1.1.9  christos        ND_PRINT("ERROR: length %u != 4", length);
   1008       1.1  christos        return;
   1009       1.1  christos    }
   1010       1.1  christos 
   1011  1.1.1.10  christos    switch(attr_code) {
   1012       1.1  christos       case FRM_IPADDR:
   1013       1.1  christos       case LOG_IPHOST:
   1014   1.1.1.9  christos            if (GET_BE_U_4(data) == 0xFFFFFFFF )
   1015   1.1.1.9  christos               ND_PRINT("User Selected");
   1016       1.1  christos            else
   1017   1.1.1.9  christos               if (GET_BE_U_4(data) == 0xFFFFFFFE )
   1018   1.1.1.9  christos                  ND_PRINT("NAS Select");
   1019       1.1  christos               else
   1020   1.1.1.9  christos                  ND_PRINT("%s",GET_IPADDR_STRING(data));
   1021       1.1  christos       break;
   1022       1.1  christos 
   1023       1.1  christos       default:
   1024   1.1.1.9  christos           ND_PRINT("%s", GET_IPADDR_STRING(data));
   1025       1.1  christos       break;
   1026       1.1  christos    }
   1027   1.1.1.9  christos }
   1028   1.1.1.9  christos 
   1029   1.1.1.9  christos /*****************************/
   1030   1.1.1.9  christos /* Print an attribute IPv6   */
   1031   1.1.1.9  christos /* address value pointed by  */
   1032   1.1.1.9  christos /* 'data' and 'length' size. */
   1033   1.1.1.9  christos /*****************************/
   1034   1.1.1.9  christos /* Returns nothing.          */
   1035   1.1.1.9  christos /*****************************/
   1036   1.1.1.9  christos static void
   1037   1.1.1.9  christos print_attr_address6(netdissect_options *ndo,
   1038   1.1.1.9  christos                    const u_char *data, u_int length, u_short attr_code _U_)
   1039   1.1.1.9  christos {
   1040  1.1.1.10  christos    if (length != 16) {
   1041   1.1.1.9  christos        ND_PRINT("ERROR: length %u != 16", length);
   1042   1.1.1.9  christos        return;
   1043   1.1.1.9  christos    }
   1044   1.1.1.9  christos 
   1045   1.1.1.9  christos    ND_PRINT("%s", GET_IP6ADDR_STRING(data));
   1046   1.1.1.9  christos }
   1047   1.1.1.9  christos 
   1048   1.1.1.9  christos static void
   1049   1.1.1.9  christos print_attr_netmask6(netdissect_options *ndo,
   1050   1.1.1.9  christos                     const u_char *data, u_int length, u_short attr_code _U_)
   1051   1.1.1.9  christos {
   1052   1.1.1.9  christos    u_char data2[16];
   1053   1.1.1.9  christos 
   1054  1.1.1.10  christos    if (length < 2 || length > 18) {
   1055   1.1.1.9  christos        ND_PRINT("ERROR: length %u not in range (2..18)", length);
   1056   1.1.1.9  christos        return;
   1057   1.1.1.9  christos    }
   1058   1.1.1.9  christos    ND_TCHECK_LEN(data, length);
   1059  1.1.1.10  christos    if (GET_U_1(data + 1) > 128) {
   1060   1.1.1.9  christos       ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data + 1));
   1061   1.1.1.9  christos       return;
   1062   1.1.1.9  christos    }
   1063   1.1.1.9  christos 
   1064   1.1.1.9  christos    memset(data2, 0, sizeof(data2));
   1065   1.1.1.9  christos    if (length > 2)
   1066   1.1.1.9  christos       memcpy(data2, data+2, length-2);
   1067   1.1.1.9  christos 
   1068   1.1.1.9  christos    ND_PRINT("%s/%u", ip6addr_string(ndo, data2), GET_U_1(data + 1)); /* local buffer, not packet data; don't use GET_IP6ADDR_STRING() */
   1069   1.1.1.9  christos 
   1070   1.1.1.9  christos    if (GET_U_1(data + 1) > 8 * (length - 2))
   1071   1.1.1.9  christos       ND_PRINT(" (inconsistent prefix length)");
   1072       1.1  christos 
   1073       1.1  christos    return;
   1074       1.1  christos 
   1075       1.1  christos    trunc:
   1076   1.1.1.9  christos      nd_print_trunc(ndo);
   1077       1.1  christos }
   1078       1.1  christos 
   1079   1.1.1.9  christos static void
   1080   1.1.1.9  christos print_attr_mip6_home_link_prefix(netdissect_options *ndo,
   1081   1.1.1.9  christos                     const u_char *data, u_int length, u_short attr_code _U_)
   1082   1.1.1.9  christos {
   1083  1.1.1.10  christos    if (length != 17) {
   1084   1.1.1.9  christos       ND_PRINT("ERROR: length %u != 17", length);
   1085   1.1.1.9  christos       return;
   1086   1.1.1.9  christos    }
   1087   1.1.1.9  christos    ND_TCHECK_LEN(data, length);
   1088  1.1.1.10  christos    if (GET_U_1(data) > 128) {
   1089   1.1.1.9  christos       ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data));
   1090   1.1.1.9  christos       return;
   1091   1.1.1.9  christos    }
   1092   1.1.1.9  christos 
   1093   1.1.1.9  christos    ND_PRINT("%s/%u", GET_IP6ADDR_STRING(data + 1), GET_U_1(data));
   1094   1.1.1.9  christos 
   1095   1.1.1.9  christos    return;
   1096   1.1.1.9  christos 
   1097   1.1.1.9  christos    trunc:
   1098   1.1.1.9  christos      nd_print_trunc(ndo);
   1099   1.1.1.9  christos }
   1100   1.1.1.9  christos 
   1101   1.1.1.9  christos static void
   1102   1.1.1.9  christos print_attr_operator_name(netdissect_options *ndo,
   1103   1.1.1.9  christos                     const u_char *data, u_int length, u_short attr_code _U_)
   1104   1.1.1.9  christos {
   1105   1.1.1.9  christos    u_int namespace_value;
   1106   1.1.1.9  christos 
   1107   1.1.1.9  christos    ND_TCHECK_LEN(data, length);
   1108  1.1.1.10  christos    if (length < 2) {
   1109   1.1.1.9  christos       ND_PRINT("ERROR: length %u < 2", length);
   1110   1.1.1.9  christos       return;
   1111   1.1.1.9  christos    }
   1112   1.1.1.9  christos    namespace_value = GET_U_1(data);
   1113   1.1.1.9  christos    data++;
   1114   1.1.1.9  christos    ND_PRINT("[%s] ", tok2str(operator_name_vector, "unknown namespace %u", namespace_value));
   1115   1.1.1.9  christos 
   1116   1.1.1.9  christos    (void)nd_printn(ndo, data, length - 1, NULL);
   1117   1.1.1.9  christos 
   1118   1.1.1.9  christos    return;
   1119   1.1.1.9  christos 
   1120   1.1.1.9  christos    trunc:
   1121   1.1.1.9  christos       nd_print_trunc(ndo);
   1122   1.1.1.9  christos }
   1123   1.1.1.9  christos 
   1124   1.1.1.9  christos static void
   1125   1.1.1.9  christos print_attr_location_information(netdissect_options *ndo,
   1126   1.1.1.9  christos                     const u_char *data, u_int length, u_short attr_code _U_)
   1127   1.1.1.9  christos {
   1128   1.1.1.9  christos    uint16_t index;
   1129   1.1.1.9  christos    uint8_t code, entity;
   1130   1.1.1.9  christos 
   1131   1.1.1.9  christos    ND_TCHECK_LEN(data, length);
   1132  1.1.1.10  christos    if (length < 21) {
   1133   1.1.1.9  christos      ND_PRINT("ERROR: length %u < 21", length);
   1134   1.1.1.9  christos       return;
   1135   1.1.1.9  christos    }
   1136   1.1.1.9  christos 
   1137   1.1.1.9  christos    index = GET_BE_U_2(data);
   1138   1.1.1.9  christos    data += 2;
   1139   1.1.1.9  christos 
   1140   1.1.1.9  christos    code = GET_U_1(data);
   1141   1.1.1.9  christos    data++;
   1142   1.1.1.9  christos 
   1143   1.1.1.9  christos    entity = GET_U_1(data);
   1144   1.1.1.9  christos    data++;
   1145   1.1.1.9  christos 
   1146   1.1.1.9  christos    ND_PRINT("index %u, code %s, entity %s, ",
   1147   1.1.1.9  christos        index,
   1148   1.1.1.9  christos        tok2str(location_information_code_vector, "Unknown (%u)", code),
   1149   1.1.1.9  christos        tok2str(location_information_entity_vector, "Unknown (%u)", entity)
   1150   1.1.1.9  christos    );
   1151   1.1.1.9  christos 
   1152   1.1.1.9  christos    ND_PRINT("sighting time ");
   1153   1.1.1.9  christos    p_ntp_time(ndo, (const struct l_fixedpt *)data);
   1154   1.1.1.9  christos    ND_PRINT(", ");
   1155   1.1.1.9  christos    data += 8;
   1156   1.1.1.9  christos 
   1157   1.1.1.9  christos    ND_PRINT("time to live ");
   1158   1.1.1.9  christos    p_ntp_time(ndo, (const struct l_fixedpt *)data);
   1159   1.1.1.9  christos    ND_PRINT(", ");
   1160   1.1.1.9  christos    data += 8;
   1161   1.1.1.9  christos 
   1162   1.1.1.9  christos    ND_PRINT("method \"");
   1163   1.1.1.9  christos    (void)nd_printn(ndo, data, length - 20, NULL);
   1164   1.1.1.9  christos    ND_PRINT("\"");
   1165   1.1.1.9  christos 
   1166   1.1.1.9  christos    return;
   1167   1.1.1.9  christos 
   1168   1.1.1.9  christos    trunc:
   1169   1.1.1.9  christos       nd_print_trunc(ndo);
   1170   1.1.1.9  christos }
   1171   1.1.1.9  christos 
   1172   1.1.1.9  christos static void
   1173   1.1.1.9  christos print_attr_location_data(netdissect_options *ndo,
   1174   1.1.1.9  christos                     const u_char *data, u_int length, u_short attr_code _U_)
   1175   1.1.1.9  christos {
   1176   1.1.1.9  christos    uint16_t index;
   1177   1.1.1.9  christos 
   1178   1.1.1.9  christos    ND_TCHECK_LEN(data, length);
   1179  1.1.1.10  christos    if (length < 3) {
   1180   1.1.1.9  christos      ND_PRINT("ERROR: length %u < 3", length);
   1181   1.1.1.9  christos       return;
   1182   1.1.1.9  christos    }
   1183   1.1.1.9  christos 
   1184   1.1.1.9  christos    index = GET_BE_U_2(data);
   1185   1.1.1.9  christos    data += 2;
   1186   1.1.1.9  christos    ND_PRINT("index %u, location", index);
   1187   1.1.1.9  christos 
   1188   1.1.1.9  christos    /* The Location field of the String field of the Location-Data attribute
   1189   1.1.1.9  christos     * can have two completely different structures depending on the value of
   1190   1.1.1.9  christos     * the Code field of a Location-Info attribute, which supposedly precedes
   1191   1.1.1.9  christos     * the current attribute. Unfortunately, this choice of encoding makes it
   1192   1.1.1.9  christos     * non-trivial to decode the Location field without preserving some state
   1193   1.1.1.9  christos     * between the attributes.
   1194   1.1.1.9  christos     */
   1195   1.1.1.9  christos    hex_and_ascii_print(ndo, "\n\t    ", data, length - 2);
   1196   1.1.1.9  christos 
   1197   1.1.1.9  christos    return;
   1198   1.1.1.9  christos 
   1199   1.1.1.9  christos    trunc:
   1200   1.1.1.9  christos       nd_print_trunc(ndo);
   1201   1.1.1.9  christos }
   1202   1.1.1.9  christos 
   1203   1.1.1.9  christos static void
   1204   1.1.1.9  christos print_basic_location_policy_rules(netdissect_options *ndo,
   1205   1.1.1.9  christos                     const u_char *data, u_int length, u_short attr_code _U_)
   1206   1.1.1.9  christos {
   1207   1.1.1.9  christos    uint16_t flags;
   1208   1.1.1.9  christos 
   1209   1.1.1.9  christos    ND_TCHECK_LEN(data, length);
   1210  1.1.1.10  christos    if (length < 10) {
   1211   1.1.1.9  christos      ND_PRINT("ERROR: length %u < 10", length);
   1212   1.1.1.9  christos       return;
   1213   1.1.1.9  christos    }
   1214   1.1.1.9  christos 
   1215   1.1.1.9  christos    flags = GET_BE_U_2(data);
   1216   1.1.1.9  christos    data += 2;
   1217   1.1.1.9  christos    ND_PRINT("flags [%s], ", bittok2str(blpr_bm, "none", flags));
   1218   1.1.1.9  christos 
   1219   1.1.1.9  christos    ND_PRINT("retention expires ");
   1220   1.1.1.9  christos    p_ntp_time(ndo, (const struct l_fixedpt *)data);
   1221   1.1.1.9  christos    data += 8;
   1222   1.1.1.9  christos 
   1223   1.1.1.9  christos    if (length > 10) {
   1224   1.1.1.9  christos       ND_PRINT(", note well \"");
   1225   1.1.1.9  christos       (void)nd_printn(ndo, data, length - 10, NULL);
   1226   1.1.1.9  christos       ND_PRINT("\"");
   1227   1.1.1.9  christos    }
   1228   1.1.1.9  christos 
   1229   1.1.1.9  christos    return;
   1230   1.1.1.9  christos 
   1231   1.1.1.9  christos    trunc:
   1232   1.1.1.9  christos       nd_print_trunc(ndo);
   1233   1.1.1.9  christos }
   1234   1.1.1.9  christos 
   1235   1.1.1.9  christos 
   1236       1.1  christos /*************************************/
   1237       1.1  christos /* Print an attribute of 'secs since */
   1238       1.1  christos /* January 1, 1970 00:00 UTC' value  */
   1239       1.1  christos /* pointed by 'data' and 'length'    */
   1240       1.1  christos /* size.                             */
   1241       1.1  christos /*************************************/
   1242       1.1  christos /* Returns nothing.                  */
   1243       1.1  christos /*************************************/
   1244   1.1.1.4  christos static void
   1245   1.1.1.4  christos print_attr_time(netdissect_options *ndo,
   1246   1.1.1.9  christos                 const u_char *data, u_int length, u_short attr_code _U_)
   1247       1.1  christos {
   1248       1.1  christos    time_t attr_time;
   1249       1.1  christos    char string[26];
   1250       1.1  christos 
   1251  1.1.1.10  christos    if (length != 4) {
   1252   1.1.1.9  christos        ND_PRINT("ERROR: length %u != 4", length);
   1253       1.1  christos        return;
   1254       1.1  christos    }
   1255       1.1  christos 
   1256   1.1.1.9  christos    attr_time = GET_BE_U_4(data);
   1257       1.1  christos    strlcpy(string, ctime(&attr_time), sizeof(string));
   1258       1.1  christos    /* Get rid of the newline */
   1259       1.1  christos    string[24] = '\0';
   1260   1.1.1.9  christos    ND_PRINT("%.24s", string);
   1261   1.1.1.9  christos }
   1262       1.1  christos 
   1263   1.1.1.9  christos static void
   1264   1.1.1.9  christos print_attr_vector64(netdissect_options *ndo,
   1265  1.1.1.10  christos 		    const u_char *data, u_int length, u_short attr_code _U_)
   1266   1.1.1.9  christos {
   1267   1.1.1.9  christos    uint64_t data_value, i;
   1268   1.1.1.9  christos    const char *sep = "";
   1269   1.1.1.9  christos 
   1270  1.1.1.10  christos    if (length != 8) {
   1271   1.1.1.9  christos        ND_PRINT("ERROR: length %u != 8", length);
   1272   1.1.1.9  christos        return;
   1273   1.1.1.9  christos    }
   1274   1.1.1.9  christos 
   1275   1.1.1.9  christos    ND_PRINT("[");
   1276   1.1.1.9  christos 
   1277   1.1.1.9  christos    data_value = GET_BE_U_8(data);
   1278   1.1.1.9  christos    /* Print the 64-bit field in a format similar to bittok2str(), less
   1279   1.1.1.9  christos     * flagging any unknown bits. This way it should be easier to replace
   1280   1.1.1.9  christos     * the custom code with a library function later.
   1281   1.1.1.9  christos     */
   1282   1.1.1.9  christos    for (i = 0; i < TAM_SIZE(mip6_feature_vector); i++) {
   1283   1.1.1.9  christos        if (data_value & mip6_feature_vector[i].v) {
   1284   1.1.1.9  christos            ND_PRINT("%s%s", sep, mip6_feature_vector[i].s);
   1285   1.1.1.9  christos            sep = ", ";
   1286   1.1.1.9  christos        }
   1287   1.1.1.9  christos    }
   1288   1.1.1.9  christos 
   1289   1.1.1.9  christos    ND_PRINT("]");
   1290       1.1  christos }
   1291       1.1  christos 
   1292       1.1  christos /***********************************/
   1293       1.1  christos /* Print an attribute of 'strange' */
   1294       1.1  christos /* data format pointed by 'data'   */
   1295       1.1  christos /* and 'length' size.              */
   1296       1.1  christos /***********************************/
   1297       1.1  christos /* Returns nothing.                */
   1298       1.1  christos /***********************************/
   1299   1.1.1.4  christos static void
   1300   1.1.1.4  christos print_attr_strange(netdissect_options *ndo,
   1301   1.1.1.9  christos                    const u_char *data, u_int length, u_short attr_code)
   1302       1.1  christos {
   1303       1.1  christos    u_short len_data;
   1304   1.1.1.9  christos    u_int error_cause_value;
   1305       1.1  christos 
   1306  1.1.1.10  christos    switch(attr_code) {
   1307       1.1  christos       case ARAP_PASS:
   1308  1.1.1.10  christos            if (length != 16) {
   1309   1.1.1.9  christos                ND_PRINT("ERROR: length %u != 16", length);
   1310       1.1  christos                return;
   1311       1.1  christos            }
   1312   1.1.1.9  christos            ND_PRINT("User_challenge (");
   1313       1.1  christos            len_data = 8;
   1314       1.1  christos            PRINT_HEX(len_data, data);
   1315   1.1.1.9  christos            ND_PRINT(") User_resp(");
   1316       1.1  christos            len_data = 8;
   1317       1.1  christos            PRINT_HEX(len_data, data);
   1318   1.1.1.9  christos            ND_PRINT(")");
   1319       1.1  christos         break;
   1320       1.1  christos 
   1321       1.1  christos       case ARAP_FEATURES:
   1322  1.1.1.10  christos            if (length != 14) {
   1323   1.1.1.9  christos                ND_PRINT("ERROR: length %u != 14", length);
   1324       1.1  christos                return;
   1325       1.1  christos            }
   1326   1.1.1.9  christos            if (GET_U_1(data))
   1327   1.1.1.9  christos               ND_PRINT("User can change password");
   1328       1.1  christos            else
   1329   1.1.1.9  christos               ND_PRINT("User cannot change password");
   1330       1.1  christos            data++;
   1331   1.1.1.9  christos            ND_PRINT(", Min password length: %u", GET_U_1(data));
   1332       1.1  christos            data++;
   1333   1.1.1.9  christos            ND_PRINT(", created at: ");
   1334       1.1  christos            len_data = 4;
   1335       1.1  christos            PRINT_HEX(len_data, data);
   1336   1.1.1.9  christos            ND_PRINT(", expires in: ");
   1337       1.1  christos            len_data = 4;
   1338       1.1  christos            PRINT_HEX(len_data, data);
   1339   1.1.1.9  christos            ND_PRINT(", Current Time: ");
   1340       1.1  christos            len_data = 4;
   1341       1.1  christos            PRINT_HEX(len_data, data);
   1342       1.1  christos         break;
   1343       1.1  christos 
   1344       1.1  christos       case ARAP_CHALLENGE_RESP:
   1345  1.1.1.10  christos            if (length < 8) {
   1346   1.1.1.9  christos                ND_PRINT("ERROR: length %u != 8", length);
   1347       1.1  christos                return;
   1348       1.1  christos            }
   1349       1.1  christos            len_data = 8;
   1350       1.1  christos            PRINT_HEX(len_data, data);
   1351       1.1  christos         break;
   1352   1.1.1.9  christos 
   1353   1.1.1.9  christos       case ERROR_CAUSE:
   1354  1.1.1.10  christos            if (length != 4) {
   1355   1.1.1.9  christos                ND_PRINT("Error: length %u != 4", length);
   1356   1.1.1.9  christos                return;
   1357   1.1.1.9  christos            }
   1358   1.1.1.9  christos 
   1359   1.1.1.9  christos            error_cause_value = GET_BE_U_4(data);
   1360   1.1.1.9  christos            ND_PRINT("Error cause %u: %s", error_cause_value, tok2str(errorcausetype, "Error-Cause %u not known", error_cause_value));
   1361   1.1.1.9  christos         break;
   1362       1.1  christos    }
   1363       1.1  christos    return;
   1364       1.1  christos }
   1365       1.1  christos 
   1366       1.1  christos static void
   1367   1.1.1.4  christos radius_attrs_print(netdissect_options *ndo,
   1368   1.1.1.9  christos                    const u_char *attr, u_int length)
   1369       1.1  christos {
   1370   1.1.1.9  christos    const struct radius_attr *rad_attr = (const struct radius_attr *)attr;
   1371       1.1  christos    const char *attr_string;
   1372   1.1.1.9  christos    uint8_t type, len;
   1373       1.1  christos 
   1374  1.1.1.10  christos    while (length > 0) {
   1375       1.1  christos      if (length < 2)
   1376       1.1  christos         goto trunc;
   1377   1.1.1.9  christos      ND_TCHECK_SIZE(rad_attr);
   1378   1.1.1.4  christos 
   1379   1.1.1.9  christos      type = GET_U_1(rad_attr->type);
   1380   1.1.1.9  christos      len = GET_U_1(rad_attr->len);
   1381   1.1.1.9  christos      if (type != 0 && type < TAM_SIZE(attr_type))
   1382   1.1.1.9  christos 	attr_string = attr_type[type].name;
   1383       1.1  christos      else
   1384       1.1  christos 	attr_string = "Unknown";
   1385   1.1.1.9  christos 
   1386   1.1.1.9  christos      ND_PRINT("\n\t  %s Attribute (%u), length: %u",
   1387       1.1  christos                attr_string,
   1388   1.1.1.9  christos                type,
   1389   1.1.1.9  christos                len);
   1390  1.1.1.10  christos      if (len < 2) {
   1391   1.1.1.9  christos        ND_PRINT(" (bogus, must be >= 2)");
   1392   1.1.1.9  christos        return;
   1393       1.1  christos      }
   1394  1.1.1.10  christos      if (len > length) {
   1395   1.1.1.9  christos         ND_PRINT(" (bogus, goes past end of packet)");
   1396       1.1  christos         return;
   1397       1.1  christos      }
   1398   1.1.1.9  christos      ND_PRINT(", Value: ");
   1399       1.1  christos 
   1400  1.1.1.10  christos      if (type < TAM_SIZE(attr_type)) {
   1401  1.1.1.10  christos          if (len > 2) {
   1402   1.1.1.9  christos              if ( attr_type[type].print_func )
   1403   1.1.1.9  christos                  (*attr_type[type].print_func)(
   1404   1.1.1.6  christos                      ndo, ((const u_char *)(rad_attr+1)),
   1405   1.1.1.9  christos                      len - 2, type);
   1406       1.1  christos          }
   1407       1.1  christos      }
   1408       1.1  christos      /* do we also want to see a hex dump ? */
   1409   1.1.1.4  christos      if (ndo->ndo_vflag> 1)
   1410   1.1.1.9  christos          print_unknown_data(ndo, (const u_char *)rad_attr+2, "\n\t    ", (len)-2);
   1411       1.1  christos 
   1412   1.1.1.9  christos      length-=(len);
   1413   1.1.1.9  christos      rad_attr = (const struct radius_attr *)( ((const char *)(rad_attr))+len);
   1414       1.1  christos    }
   1415       1.1  christos    return;
   1416       1.1  christos 
   1417       1.1  christos trunc:
   1418   1.1.1.9  christos    nd_print_trunc(ndo);
   1419       1.1  christos }
   1420       1.1  christos 
   1421       1.1  christos void
   1422   1.1.1.4  christos radius_print(netdissect_options *ndo,
   1423   1.1.1.4  christos              const u_char *dat, u_int length)
   1424       1.1  christos {
   1425   1.1.1.9  christos    const struct radius_hdr *rad;
   1426       1.1  christos    u_int len, auth_idx;
   1427       1.1  christos 
   1428   1.1.1.9  christos    ndo->ndo_protocol = "radius";
   1429   1.1.1.9  christos    ND_TCHECK_LEN(dat, MIN_RADIUS_LEN);
   1430   1.1.1.6  christos    rad = (const struct radius_hdr *)dat;
   1431   1.1.1.9  christos    len = GET_BE_U_2(rad->len);
   1432       1.1  christos 
   1433  1.1.1.10  christos    if (len < MIN_RADIUS_LEN) {
   1434   1.1.1.9  christos 	  nd_print_trunc(ndo);
   1435       1.1  christos 	  return;
   1436       1.1  christos    }
   1437       1.1  christos 
   1438       1.1  christos    if (len > length)
   1439       1.1  christos 	  len = length;
   1440       1.1  christos 
   1441   1.1.1.4  christos    if (ndo->ndo_vflag < 1) {
   1442   1.1.1.9  christos        ND_PRINT("RADIUS, %s (%u), id: 0x%02x length: %u",
   1443   1.1.1.9  christos               tok2str(radius_command_values,"Unknown Command",GET_U_1(rad->code)),
   1444   1.1.1.9  christos               GET_U_1(rad->code),
   1445   1.1.1.9  christos               GET_U_1(rad->id),
   1446   1.1.1.9  christos               len);
   1447       1.1  christos        return;
   1448  1.1.1.10  christos    } else {
   1449   1.1.1.9  christos        ND_PRINT("RADIUS, length: %u\n\t%s (%u), id: 0x%02x, Authenticator: ",
   1450       1.1  christos               len,
   1451   1.1.1.9  christos               tok2str(radius_command_values,"Unknown Command",GET_U_1(rad->code)),
   1452   1.1.1.9  christos               GET_U_1(rad->code),
   1453   1.1.1.9  christos               GET_U_1(rad->id));
   1454       1.1  christos 
   1455       1.1  christos        for(auth_idx=0; auth_idx < 16; auth_idx++)
   1456   1.1.1.9  christos             ND_PRINT("%02x", rad->auth[auth_idx]);
   1457       1.1  christos    }
   1458       1.1  christos 
   1459       1.1  christos    if (len > MIN_RADIUS_LEN)
   1460   1.1.1.4  christos       radius_attrs_print(ndo, dat + MIN_RADIUS_LEN, len - MIN_RADIUS_LEN);
   1461       1.1  christos    return;
   1462       1.1  christos 
   1463       1.1  christos trunc:
   1464   1.1.1.9  christos    nd_print_trunc(ndo);
   1465       1.1  christos }
   1466