Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/tcpdump/print-radius.c
Show All 31 Lines | |||||
* "RADIUS Accounting Modifications for Tunnel Protocol Support" | * "RADIUS Accounting Modifications for Tunnel Protocol Support" | ||||
* | * | ||||
* RFC 2868: | * RFC 2868: | ||||
* "RADIUS Attributes for Tunnel Protocol Support" | * "RADIUS Attributes for Tunnel Protocol Support" | ||||
* | * | ||||
* RFC 2869: | * RFC 2869: | ||||
* "RADIUS Extensions" | * "RADIUS Extensions" | ||||
* | * | ||||
* RFC 4675: | |||||
* "RADIUS Attributes for Virtual LAN and Priority Support" | |||||
* | |||||
* RFC 5176: | |||||
* "Dynamic Authorization Extensions to RADIUS" | |||||
* | |||||
* Alfredo Andres Omella (aandres@s21sec.com) v0.1 2000/09/15 | * Alfredo Andres Omella (aandres@s21sec.com) v0.1 2000/09/15 | ||||
* | * | ||||
* TODO: Among other things to print ok MacIntosh and Vendor values | * TODO: Among other things to print ok MacIntosh and Vendor values | ||||
*/ | */ | ||||
#define NETDISSECT_REWORKED | #define NETDISSECT_REWORKED | ||||
#ifdef HAVE_CONFIG_H | #ifdef HAVE_CONFIG_H | ||||
#include "config.h" | #include "config.h" | ||||
Show All 25 Lines | |||||
#define RADCMD_ACCESS_REQ 1 /* Access-Request */ | #define RADCMD_ACCESS_REQ 1 /* Access-Request */ | ||||
#define RADCMD_ACCESS_ACC 2 /* Access-Accept */ | #define RADCMD_ACCESS_ACC 2 /* Access-Accept */ | ||||
#define RADCMD_ACCESS_REJ 3 /* Access-Reject */ | #define RADCMD_ACCESS_REJ 3 /* Access-Reject */ | ||||
#define RADCMD_ACCOUN_REQ 4 /* Accounting-Request */ | #define RADCMD_ACCOUN_REQ 4 /* Accounting-Request */ | ||||
#define RADCMD_ACCOUN_RES 5 /* Accounting-Response */ | #define RADCMD_ACCOUN_RES 5 /* Accounting-Response */ | ||||
#define RADCMD_ACCESS_CHA 11 /* Access-Challenge */ | #define RADCMD_ACCESS_CHA 11 /* Access-Challenge */ | ||||
#define RADCMD_STATUS_SER 12 /* Status-Server */ | #define RADCMD_STATUS_SER 12 /* Status-Server */ | ||||
#define RADCMD_STATUS_CLI 13 /* Status-Client */ | #define RADCMD_STATUS_CLI 13 /* Status-Client */ | ||||
#define RADCMD_DISCON_REQ 40 /* Disconnect-Request */ | |||||
#define RADCMD_DISCON_ACK 41 /* Disconnect-ACK */ | |||||
#define RADCMD_DISCON_NAK 42 /* Disconnect-NAK */ | |||||
#define RADCMD_COA_REQ 43 /* CoA-Request */ | |||||
#define RADCMD_COA_ACK 44 /* CoA-ACK */ | |||||
#define RADCMD_COA_NAK 45 /* CoA-NAK */ | |||||
#define RADCMD_RESERVED 255 /* Reserved */ | #define RADCMD_RESERVED 255 /* Reserved */ | ||||
static const struct tok radius_command_values[] = { | static const struct tok radius_command_values[] = { | ||||
{ RADCMD_ACCESS_REQ, "Access Request" }, | { RADCMD_ACCESS_REQ, "Access-Request" }, | ||||
{ RADCMD_ACCESS_ACC, "Access Accept" }, | { RADCMD_ACCESS_ACC, "Access-Accept" }, | ||||
{ RADCMD_ACCESS_REJ, "Access Reject" }, | { RADCMD_ACCESS_REJ, "Access-Reject" }, | ||||
{ RADCMD_ACCOUN_REQ, "Accounting Request" }, | { RADCMD_ACCOUN_REQ, "Accounting-Request" }, | ||||
{ RADCMD_ACCOUN_RES, "Accounting Response" }, | { RADCMD_ACCOUN_RES, "Accounting-Response" }, | ||||
{ RADCMD_ACCESS_CHA, "Access Challenge" }, | { RADCMD_ACCESS_CHA, "Access-Challenge" }, | ||||
{ RADCMD_STATUS_SER, "Status Server" }, | { RADCMD_STATUS_SER, "Status-Server" }, | ||||
{ RADCMD_STATUS_CLI, "Status Client" }, | { RADCMD_STATUS_CLI, "Status-Client" }, | ||||
{ RADCMD_DISCON_REQ, "Disconnect-Request" }, | |||||
{ RADCMD_DISCON_ACK, "Disconnect-ACK" }, | |||||
{ RADCMD_DISCON_NAK, "Disconnect-NAK" }, | |||||
{ RADCMD_COA_REQ, "CoA-Request" }, | |||||
{ RADCMD_COA_ACK, "CoA-ACK" }, | |||||
{ RADCMD_COA_NAK, "CoA-NAK" }, | |||||
{ RADCMD_RESERVED, "Reserved" }, | { RADCMD_RESERVED, "Reserved" }, | ||||
{ 0, NULL} | { 0, NULL} | ||||
}; | }; | ||||
/********************************/ | /********************************/ | ||||
/* Begin Radius Attribute types */ | /* Begin Radius Attribute types */ | ||||
/********************************/ | /********************************/ | ||||
#define SERV_TYPE 6 | #define SERV_TYPE 6 | ||||
#define FRM_IPADDR 8 | #define FRM_IPADDR 8 | ||||
#define LOG_IPHOST 14 | #define LOG_IPHOST 14 | ||||
#define LOG_SERVICE 15 | #define LOG_SERVICE 15 | ||||
#define FRM_IPX 23 | #define FRM_IPX 23 | ||||
#define SESSION_TIMEOUT 27 | #define SESSION_TIMEOUT 27 | ||||
#define IDLE_TIMEOUT 28 | #define IDLE_TIMEOUT 28 | ||||
#define FRM_ATALK_LINK 37 | #define FRM_ATALK_LINK 37 | ||||
#define FRM_ATALK_NETWORK 38 | #define FRM_ATALK_NETWORK 38 | ||||
#define ACCT_DELAY 41 | #define ACCT_DELAY 41 | ||||
#define ACCT_SESSION_TIME 46 | #define ACCT_SESSION_TIME 46 | ||||
#define EGRESS_VLAN_ID 56 | |||||
#define EGRESS_VLAN_NAME 58 | |||||
#define TUNNEL_TYPE 64 | #define TUNNEL_TYPE 64 | ||||
#define TUNNEL_MEDIUM 65 | #define TUNNEL_MEDIUM 65 | ||||
#define TUNNEL_CLIENT_END 66 | #define TUNNEL_CLIENT_END 66 | ||||
#define TUNNEL_SERVER_END 67 | #define TUNNEL_SERVER_END 67 | ||||
#define TUNNEL_PASS 69 | #define TUNNEL_PASS 69 | ||||
#define ARAP_PASS 70 | #define ARAP_PASS 70 | ||||
#define ARAP_FEATURES 71 | #define ARAP_FEATURES 71 | ||||
#define TUNNEL_PRIV_GROUP 81 | #define TUNNEL_PRIV_GROUP 81 | ||||
#define TUNNEL_ASSIGN_ID 82 | #define TUNNEL_ASSIGN_ID 82 | ||||
#define TUNNEL_PREFERENCE 83 | #define TUNNEL_PREFERENCE 83 | ||||
#define ARAP_CHALLENGE_RESP 84 | #define ARAP_CHALLENGE_RESP 84 | ||||
#define ACCT_INT_INTERVAL 85 | #define ACCT_INT_INTERVAL 85 | ||||
#define TUNNEL_CLIENT_AUTH 90 | #define TUNNEL_CLIENT_AUTH 90 | ||||
#define TUNNEL_SERVER_AUTH 91 | #define TUNNEL_SERVER_AUTH 91 | ||||
/********************************/ | /********************************/ | ||||
/* End Radius Attribute types */ | /* End Radius Attribute types */ | ||||
/********************************/ | /********************************/ | ||||
#define RFC4675_TAGGED 0x31 | |||||
#define RFC4675_UNTAGGED 0x32 | |||||
static const struct tok rfc4675_tagged[] = { | |||||
{ RFC4675_TAGGED, "Tagged" }, | |||||
{ RFC4675_UNTAGGED, "Untagged" }, | |||||
{ 0, NULL} | |||||
}; | |||||
static void print_attr_string(netdissect_options *, register u_char *, u_int, u_short ); | static void print_attr_string(netdissect_options *, register u_char *, u_int, u_short ); | ||||
static void print_attr_num(netdissect_options *, register u_char *, u_int, u_short ); | static void print_attr_num(netdissect_options *, register u_char *, u_int, u_short ); | ||||
static void print_vendor_attr(netdissect_options *, register u_char *, u_int, u_short ); | static void print_vendor_attr(netdissect_options *, register u_char *, u_int, u_short ); | ||||
static void print_attr_address(netdissect_options *, register u_char *, u_int, u_short); | static void print_attr_address(netdissect_options *, register u_char *, u_int, u_short); | ||||
static void print_attr_time(netdissect_options *, register u_char *, u_int, u_short); | static void print_attr_time(netdissect_options *, register u_char *, u_int, u_short); | ||||
static void print_attr_strange(netdissect_options *, register u_char *, u_int, u_short); | static void print_attr_strange(netdissect_options *, register u_char *, u_int, u_short); | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | static const char *login_serv[]={ "Telnet", | ||||
}; | }; | ||||
/* Termination-Action Attribute standard values */ | /* Termination-Action Attribute standard values */ | ||||
static const char *term_action[]={ "Default", | static const char *term_action[]={ "Default", | ||||
"RADIUS-Request", | "RADIUS-Request", | ||||
}; | }; | ||||
/* Ingress-Filters Attribute standard values */ | |||||
static const char *ingress_filters[]={ NULL, | |||||
"Enabled", | |||||
"Disabled", | |||||
}; | |||||
/* NAS-Port-Type Attribute standard values */ | /* NAS-Port-Type Attribute standard values */ | ||||
static const char *nas_port_type[]={ "Async", | static const char *nas_port_type[]={ "Async", | ||||
"Sync", | "Sync", | ||||
"ISDN Sync", | "ISDN Sync", | ||||
"ISDN Async V.120", | "ISDN Async V.120", | ||||
"ISDN Async V.110", | "ISDN Async V.110", | ||||
"Virtual", | "Virtual", | ||||
"PIAFS", | "PIAFS", | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | |||||
struct attrtype { const char *name; /* Attribute name */ | struct attrtype { const char *name; /* Attribute name */ | ||||
const char **subtypes; /* Standard Values (if any) */ | const char **subtypes; /* Standard Values (if any) */ | ||||
u_char siz_subtypes; /* Size of total standard values */ | u_char siz_subtypes; /* Size of total standard values */ | ||||
u_char first_subtype; /* First standard value is 0 or 1 */ | u_char first_subtype; /* First standard value is 0 or 1 */ | ||||
void (*print_func)(netdissect_options *, register u_char *, u_int, u_short); | void (*print_func)(netdissect_options *, register u_char *, u_int, u_short); | ||||
} attr_type[]= | } attr_type[]= | ||||
{ | { | ||||
{ NULL, NULL, 0, 0, NULL }, | { NULL, NULL, 0, 0, NULL }, | ||||
{ "Username", NULL, 0, 0, print_attr_string }, | { "User-Name", NULL, 0, 0, print_attr_string }, | ||||
{ "Password", NULL, 0, 0, NULL }, | { "User-Password", NULL, 0, 0, NULL }, | ||||
{ "CHAP Password", NULL, 0, 0, NULL }, | { "CHAP-Password", NULL, 0, 0, NULL }, | ||||
{ "NAS IP Address", NULL, 0, 0, print_attr_address }, | { "NAS-IP-Address", NULL, 0, 0, print_attr_address }, | ||||
{ "NAS Port", NULL, 0, 0, print_attr_num }, | { "NAS-Port", NULL, 0, 0, print_attr_num }, | ||||
{ "Service Type", serv_type, TAM_SIZE(serv_type)-1, 1, print_attr_num }, | { "Service-Type", serv_type, TAM_SIZE(serv_type)-1, 1, print_attr_num }, | ||||
{ "Framed Protocol", frm_proto, TAM_SIZE(frm_proto)-1, 1, print_attr_num }, | { "Framed-Protocol", frm_proto, TAM_SIZE(frm_proto)-1, 1, print_attr_num }, | ||||
{ "Framed IP Address", NULL, 0, 0, print_attr_address }, | { "Framed-IP-Address", NULL, 0, 0, print_attr_address }, | ||||
{ "Framed IP Network", NULL, 0, 0, print_attr_address }, | { "Framed-IP-Netmask", NULL, 0, 0, print_attr_address }, | ||||
{ "Framed Routing", frm_routing, TAM_SIZE(frm_routing), 0, print_attr_num }, | { "Framed-Routing", frm_routing, TAM_SIZE(frm_routing), 0, print_attr_num }, | ||||
{ "Filter ID", NULL, 0, 0, print_attr_string }, | { "Filter-Id", NULL, 0, 0, print_attr_string }, | ||||
{ "Framed MTU", NULL, 0, 0, print_attr_num }, | { "Framed-MTU", NULL, 0, 0, print_attr_num }, | ||||
{ "Framed Compression", frm_comp, TAM_SIZE(frm_comp), 0, print_attr_num }, | { "Framed-Compression", frm_comp, TAM_SIZE(frm_comp), 0, print_attr_num }, | ||||
{ "Login IP Host", NULL, 0, 0, print_attr_address }, | { "Login-IP-Host", NULL, 0, 0, print_attr_address }, | ||||
{ "Login Service", login_serv, TAM_SIZE(login_serv), 0, print_attr_num }, | { "Login-Service", login_serv, TAM_SIZE(login_serv), 0, print_attr_num }, | ||||
{ "Login TCP Port", NULL, 0, 0, print_attr_num }, | { "Login-TCP-Port", NULL, 0, 0, print_attr_num }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*17*/ | { "Unassigned", NULL, 0, 0, NULL }, /*17*/ | ||||
{ "Reply", NULL, 0, 0, print_attr_string }, | { "Reply-Message", NULL, 0, 0, print_attr_string }, | ||||
{ "Callback-number", NULL, 0, 0, print_attr_string }, | { "Callback-Number", NULL, 0, 0, print_attr_string }, | ||||
{ "Callback-ID", NULL, 0, 0, print_attr_string }, | { "Callback-Id", NULL, 0, 0, print_attr_string }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*21*/ | { "Unassigned", NULL, 0, 0, NULL }, /*21*/ | ||||
{ "Framed Route", NULL, 0, 0, print_attr_string }, | { "Framed-Route", NULL, 0, 0, print_attr_string }, | ||||
{ "Framed IPX Network", NULL, 0, 0, print_attr_num }, | { "Framed-IPX-Network", NULL, 0, 0, print_attr_num }, | ||||
{ "State", NULL, 0, 0, print_attr_string }, | { "State", NULL, 0, 0, print_attr_string }, | ||||
{ "Class", NULL, 0, 0, print_attr_string }, | { "Class", NULL, 0, 0, print_attr_string }, | ||||
{ "Vendor Specific", NULL, 0, 0, print_vendor_attr }, | { "Vendor-Specific", NULL, 0, 0, print_vendor_attr }, | ||||
{ "Session Timeout", NULL, 0, 0, print_attr_num }, | { "Session-Timeout", NULL, 0, 0, print_attr_num }, | ||||
{ "Idle Timeout", NULL, 0, 0, print_attr_num }, | { "Idle-Timeout", NULL, 0, 0, print_attr_num }, | ||||
{ "Termination Action", term_action, TAM_SIZE(term_action), 0, print_attr_num }, | { "Termination-Action", term_action, TAM_SIZE(term_action), 0, print_attr_num }, | ||||
{ "Called Station", NULL, 0, 0, print_attr_string }, | { "Called-Station-Id", NULL, 0, 0, print_attr_string }, | ||||
{ "Calling Station", NULL, 0, 0, print_attr_string }, | { "Calling-Station-Id", NULL, 0, 0, print_attr_string }, | ||||
{ "NAS ID", NULL, 0, 0, print_attr_string }, | { "NAS-Identifier", NULL, 0, 0, print_attr_string }, | ||||
{ "Proxy State", NULL, 0, 0, print_attr_string }, | { "Proxy-State", NULL, 0, 0, print_attr_string }, | ||||
{ "Login LAT Service", NULL, 0, 0, print_attr_string }, | { "Login-LAT-Service", NULL, 0, 0, print_attr_string }, | ||||
{ "Login LAT Node", NULL, 0, 0, print_attr_string }, | { "Login-LAT-Node", NULL, 0, 0, print_attr_string }, | ||||
{ "Login LAT Group", NULL, 0, 0, print_attr_string }, | { "Login-LAT-Group", NULL, 0, 0, print_attr_string }, | ||||
{ "Framed Appletalk Link", NULL, 0, 0, print_attr_num }, | { "Framed-AppleTalk-Link", NULL, 0, 0, print_attr_num }, | ||||
{ "Framed Appltalk Net", NULL, 0, 0, print_attr_num }, | { "Framed-AppleTalk-Network", NULL, 0, 0, print_attr_num }, | ||||
{ "Framed Appletalk Zone", NULL, 0, 0, print_attr_string }, | { "Framed-AppleTalk-Zone", NULL, 0, 0, print_attr_string }, | ||||
{ "Accounting Status", acct_status, TAM_SIZE(acct_status)-1, 1, print_attr_num }, | { "Acct-Status-Type", acct_status, TAM_SIZE(acct_status)-1, 1, print_attr_num }, | ||||
{ "Accounting Delay", NULL, 0, 0, print_attr_num }, | { "Acct-Delay-Time", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Input Octets", NULL, 0, 0, print_attr_num }, | { "Acct-Input-Octets", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Output Octets", NULL, 0, 0, print_attr_num }, | { "Acct-Output-Octets", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Session ID", NULL, 0, 0, print_attr_string }, | { "Acct-Session-Id", NULL, 0, 0, print_attr_string }, | ||||
{ "Accounting Authentication", acct_auth, TAM_SIZE(acct_auth)-1, 1, print_attr_num }, | { "Acct-Authentic", acct_auth, TAM_SIZE(acct_auth)-1, 1, print_attr_num }, | ||||
{ "Accounting Session Time", NULL, 0, 0, print_attr_num }, | { "Acct-Session-Time", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Input Packets", NULL, 0, 0, print_attr_num }, | { "Acct-Input-Packets", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Output Packets", NULL, 0, 0, print_attr_num }, | { "Acct-Output-Packets", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Termination Cause", acct_term, TAM_SIZE(acct_term)-1, 1, print_attr_num }, | { "Acct-Terminate-Cause", acct_term, TAM_SIZE(acct_term)-1, 1, print_attr_num }, | ||||
{ "Accounting Multilink Session ID", NULL, 0, 0, print_attr_string }, | { "Acct-Multi-Session-Id", NULL, 0, 0, print_attr_string }, | ||||
{ "Accounting Link Count", NULL, 0, 0, print_attr_num }, | { "Acct-Link-Count", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Input Giga", NULL, 0, 0, print_attr_num }, | { "Acct-Input-Gigawords", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Output Giga", NULL, 0, 0, print_attr_num }, | { "Acct-Output-Gigawords", NULL, 0, 0, print_attr_num }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*54*/ | { "Unassigned", NULL, 0, 0, NULL }, /*54*/ | ||||
{ "Event Timestamp", NULL, 0, 0, print_attr_time }, | { "Event-Timestamp", NULL, 0, 0, print_attr_time }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*56*/ | { "Egress-VLANID", NULL, 0, 0, print_attr_num }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*57*/ | { "Ingress-Filters", ingress_filters, TAM_SIZE(ingress_filters)-1, 1, print_attr_num }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*58*/ | { "Egress-VLAN-Name", NULL, 0, 0, print_attr_string }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*59*/ | { "User-Priority-Table", NULL, 0, 0, NULL }, | ||||
{ "CHAP challenge", NULL, 0, 0, print_attr_string }, | { "CHAP-Challenge", NULL, 0, 0, print_attr_string }, | ||||
{ "NAS Port Type", nas_port_type, TAM_SIZE(nas_port_type), 0, print_attr_num }, | { "NAS-Port-Type", nas_port_type, TAM_SIZE(nas_port_type), 0, print_attr_num }, | ||||
{ "Port Limit", NULL, 0, 0, print_attr_num }, | { "Port-Limit", NULL, 0, 0, print_attr_num }, | ||||
{ "Login LAT Port", NULL, 0, 0, print_attr_string }, /*63*/ | { "Login-LAT-Port", NULL, 0, 0, print_attr_string }, /*63*/ | ||||
{ "Tunnel Type", tunnel_type, TAM_SIZE(tunnel_type)-1, 1, print_attr_num }, | { "Tunnel-Type", tunnel_type, TAM_SIZE(tunnel_type)-1, 1, print_attr_num }, | ||||
{ "Tunnel Medium", tunnel_medium, TAM_SIZE(tunnel_medium)-1, 1, print_attr_num }, | { "Tunnel-Medium-Type", tunnel_medium, TAM_SIZE(tunnel_medium)-1, 1, print_attr_num }, | ||||
{ "Tunnel Client End", NULL, 0, 0, print_attr_string }, | { "Tunnel-Client-Endpoint", NULL, 0, 0, print_attr_string }, | ||||
{ "Tunnel Server End", NULL, 0, 0, print_attr_string }, | { "Tunnel-Server-Endpoint", NULL, 0, 0, print_attr_string }, | ||||
{ "Accounting Tunnel connect", NULL, 0, 0, print_attr_string }, | { "Acct-Tunnel-Connection", NULL, 0, 0, print_attr_string }, | ||||
{ "Tunnel Password", NULL, 0, 0, print_attr_string }, | { "Tunnel-Password", NULL, 0, 0, print_attr_string }, | ||||
{ "ARAP Password", NULL, 0, 0, print_attr_strange }, | { "ARAP-Password", NULL, 0, 0, print_attr_strange }, | ||||
{ "ARAP Feature", NULL, 0, 0, print_attr_strange }, | { "ARAP-Features", NULL, 0, 0, print_attr_strange }, | ||||
{ "ARAP Zone Acces", arap_zone, TAM_SIZE(arap_zone)-1, 1, print_attr_num }, /*72*/ | { "ARAP-Zone-Access", arap_zone, TAM_SIZE(arap_zone)-1, 1, print_attr_num }, /*72*/ | ||||
{ "ARAP Security", NULL, 0, 0, print_attr_string }, | { "ARAP-Security", NULL, 0, 0, print_attr_string }, | ||||
{ "ARAP Security Data", NULL, 0, 0, print_attr_string }, | { "ARAP-Security-Data", NULL, 0, 0, print_attr_string }, | ||||
{ "Password Retry", NULL, 0, 0, print_attr_num }, | { "Password-Retry", NULL, 0, 0, print_attr_num }, | ||||
{ "Prompt", prompt, TAM_SIZE(prompt), 0, print_attr_num }, | { "Prompt", prompt, TAM_SIZE(prompt), 0, print_attr_num }, | ||||
{ "Connect Info", NULL, 0, 0, print_attr_string }, | { "Connect-Info", NULL, 0, 0, print_attr_string }, | ||||
{ "Config Token", NULL, 0, 0, print_attr_string }, | { "Configuration-Token", NULL, 0, 0, print_attr_string }, | ||||
{ "EAP Message", NULL, 0, 0, print_attr_string }, | { "EAP-Message", NULL, 0, 0, print_attr_string }, | ||||
{ "Message Authentication", NULL, 0, 0, print_attr_string }, /*80*/ | { "Message-Authenticator", NULL, 0, 0, print_attr_string }, /*80*/ | ||||
{ "Tunnel Private Group", NULL, 0, 0, print_attr_string }, | { "Tunnel-Private-Group-ID", NULL, 0, 0, print_attr_string }, | ||||
{ "Tunnel Assigned ID", NULL, 0, 0, print_attr_string }, | { "Tunnel-Assignment-ID", NULL, 0, 0, print_attr_string }, | ||||
{ "Tunnel Preference", NULL, 0, 0, print_attr_num }, | { "Tunnel-Preference", NULL, 0, 0, print_attr_num }, | ||||
{ "ARAP Challenge Response", NULL, 0, 0, print_attr_strange }, | { "ARAP-Challenge-Response", NULL, 0, 0, print_attr_strange }, | ||||
{ "Accounting Interim Interval", NULL, 0, 0, print_attr_num }, | { "Acct-Interim-Interval", NULL, 0, 0, print_attr_num }, | ||||
{ "Accounting Tunnel packets lost", NULL, 0, 0, print_attr_num }, /*86*/ | { "Acct-Tunnel-Packets-Lost", NULL, 0, 0, print_attr_num }, /*86*/ | ||||
{ "NAS Port ID", NULL, 0, 0, print_attr_string }, | { "NAS-Port-Id", NULL, 0, 0, print_attr_string }, | ||||
{ "Framed Pool", NULL, 0, 0, print_attr_string }, | { "Framed-Pool", NULL, 0, 0, print_attr_string }, | ||||
{ "Chargeable User Identity", NULL, 0, 0, print_attr_string }, | { "CUI", NULL, 0, 0, print_attr_string }, | ||||
{ "Tunnel Client Authentication ID", NULL, 0, 0, print_attr_string }, | { "Tunnel-Client-Auth-ID", NULL, 0, 0, print_attr_string }, | ||||
{ "Tunnel Server Authentication ID", NULL, 0, 0, print_attr_string }, | { "Tunnel-Server-Auth-ID", NULL, 0, 0, print_attr_string }, | ||||
{ "Unassigned", NULL, 0, 0, NULL }, /*92*/ | { "Unassigned", NULL, 0, 0, NULL }, /*92*/ | ||||
{ "Unassigned", NULL, 0, 0, NULL } /*93*/ | { "Unassigned", NULL, 0, 0, NULL } /*93*/ | ||||
}; | }; | ||||
/*****************************/ | /*****************************/ | ||||
/* Print an attribute string */ | /* Print an attribute string */ | ||||
/* value pointed by 'data' */ | /* value pointed by 'data' */ | ||||
Show All 13 Lines | print_attr_string(netdissect_options *ndo, | ||||
{ | { | ||||
case TUNNEL_PASS: | case TUNNEL_PASS: | ||||
if (length < 3) | if (length < 3) | ||||
{ | { | ||||
ND_PRINT((ndo, "%s", tstr)); | ND_PRINT((ndo, "%s", tstr)); | ||||
return; | return; | ||||
} | } | ||||
if (*data && (*data <=0x1F) ) | if (*data && (*data <=0x1F) ) | ||||
ND_PRINT((ndo, "Tag %u, ",*data)); | ND_PRINT((ndo, "Tag[%u] ", *data)); | ||||
else | |||||
ND_PRINT((ndo, "Tag[Unused] ")); | |||||
data++; | data++; | ||||
length--; | length--; | ||||
ND_PRINT((ndo, "Salt %u ", EXTRACT_16BITS(data))); | ND_PRINT((ndo, "Salt %u ", EXTRACT_16BITS(data))); | ||||
data+=2; | data+=2; | ||||
length-=2; | length-=2; | ||||
break; | break; | ||||
case TUNNEL_CLIENT_END: | case TUNNEL_CLIENT_END: | ||||
case TUNNEL_SERVER_END: | case TUNNEL_SERVER_END: | ||||
case TUNNEL_PRIV_GROUP: | case TUNNEL_PRIV_GROUP: | ||||
case TUNNEL_ASSIGN_ID: | case TUNNEL_ASSIGN_ID: | ||||
case TUNNEL_CLIENT_AUTH: | case TUNNEL_CLIENT_AUTH: | ||||
case TUNNEL_SERVER_AUTH: | case TUNNEL_SERVER_AUTH: | ||||
if (*data <= 0x1F) | if (*data <= 0x1F) | ||||
{ | { | ||||
if (length < 1) | if (length < 1) | ||||
{ | { | ||||
ND_PRINT((ndo, "%s", tstr)); | ND_PRINT((ndo, "%s", tstr)); | ||||
return; | return; | ||||
} | } | ||||
ND_PRINT((ndo, "Tag %u", *data)); | if (*data) | ||||
ND_PRINT((ndo, "Tag[%u] ", *data)); | |||||
else | |||||
ND_PRINT((ndo, "Tag[Unused] ")); | |||||
data++; | data++; | ||||
length--; | length--; | ||||
} | } | ||||
break; | break; | ||||
case EGRESS_VLAN_NAME: | |||||
ND_PRINT((ndo, "%s (0x%02x) ", | |||||
tok2str(rfc4675_tagged,"Unknown tag",*data), | |||||
*data)); | |||||
data++; | |||||
length--; | |||||
break; | |||||
} | } | ||||
for (i=0; *data && i < length ; i++, data++) | for (i=0; *data && i < length ; i++, data++) | ||||
ND_PRINT((ndo, "%c", (*data < 32 || *data > 128) ? '.' : *data)); | ND_PRINT((ndo, "%c", (*data < 32 || *data > 128) ? '.' : *data)); | ||||
return; | return; | ||||
trunc: | trunc: | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
/* and 'length' size. */ | /* and 'length' size. */ | ||||
/******************************/ | /******************************/ | ||||
/* Returns nothing. */ | /* Returns nothing. */ | ||||
/******************************/ | /******************************/ | ||||
static void | static void | ||||
print_attr_num(netdissect_options *ndo, | print_attr_num(netdissect_options *ndo, | ||||
register u_char *data, u_int length, u_short attr_code) | register u_char *data, u_int length, u_short attr_code) | ||||
{ | { | ||||
uint8_t tag; | |||||
uint32_t timeout; | uint32_t timeout; | ||||
if (length != 4) | if (length != 4) | ||||
{ | { | ||||
ND_PRINT((ndo, "ERROR: length %u != 4", length)); | ND_PRINT((ndo, "ERROR: length %u != 4", length)); | ||||
return; | return; | ||||
} | } | ||||
ND_TCHECK2(data[0],4); | ND_TCHECK2(data[0],4); | ||||
/* This attribute has standard values */ | /* This attribute has standard values */ | ||||
if (attr_type[attr_code].siz_subtypes) | if (attr_type[attr_code].siz_subtypes) | ||||
{ | { | ||||
static const char **table; | static const char **table; | ||||
uint32_t data_value; | uint32_t data_value; | ||||
table = attr_type[attr_code].subtypes; | table = attr_type[attr_code].subtypes; | ||||
if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) ) | if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) ) | ||||
{ | { | ||||
if (!*data) | if (!*data) | ||||
ND_PRINT((ndo, "Tag[Unused]")); | ND_PRINT((ndo, "Tag[Unused] ")); | ||||
else | else | ||||
ND_PRINT((ndo, "Tag[%d]", *data)); | ND_PRINT((ndo, "Tag[%d] ", *data)); | ||||
data++; | data++; | ||||
data_value = EXTRACT_24BITS(data); | data_value = EXTRACT_24BITS(data); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
data_value = EXTRACT_32BITS(data); | data_value = EXTRACT_32BITS(data); | ||||
} | } | ||||
if ( data_value <= (uint32_t)(attr_type[attr_code].siz_subtypes - 1 + | if ( data_value <= (uint32_t)(attr_type[attr_code].siz_subtypes - 1 + | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | else | ||||
case FRM_ATALK_NETWORK: | case FRM_ATALK_NETWORK: | ||||
if (EXTRACT_32BITS(data) ) | if (EXTRACT_32BITS(data) ) | ||||
ND_PRINT((ndo, "%d", EXTRACT_32BITS(data))); | ND_PRINT((ndo, "%d", EXTRACT_32BITS(data))); | ||||
else | else | ||||
ND_PRINT((ndo, "NAS assigned")); | ND_PRINT((ndo, "NAS assigned")); | ||||
break; | break; | ||||
case TUNNEL_PREFERENCE: | case TUNNEL_PREFERENCE: | ||||
tag = *data; | if (*data) | ||||
data++; | ND_PRINT((ndo, "Tag[%d] ", *data)); | ||||
if (tag == 0) | |||||
ND_PRINT((ndo, "Tag (Unused) %d", EXTRACT_24BITS(data))); | |||||
else | else | ||||
ND_PRINT((ndo, "Tag (%d) %d", tag, EXTRACT_24BITS(data))); | ND_PRINT((ndo, "Tag[Unused] ")); | ||||
data++; | |||||
ND_PRINT((ndo, "%d", EXTRACT_24BITS(data))); | |||||
break; | |||||
case EGRESS_VLAN_ID: | |||||
ND_PRINT((ndo, "%s (0x%02x) ", | |||||
tok2str(rfc4675_tagged,"Unknown tag",*data), | |||||
*data)); | |||||
data++; | |||||
ND_PRINT((ndo, "%d", EXTRACT_24BITS(data))); | |||||
break; | break; | ||||
default: | default: | ||||
ND_PRINT((ndo, "%d", EXTRACT_32BITS(data))); | ND_PRINT((ndo, "%d", EXTRACT_32BITS(data))); | ||||
break; | break; | ||||
} /* switch */ | } /* switch */ | ||||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |