ND_PRINT(" Vendor: %s (%u)",
tok2str(oui_values,"Unknown",GET_BE_U_3(tptr)),
GET_BE_U_3(tptr));
ND_PRINT(" Vendor: %s (%u)",
tok2str(oui_values,"Unknown",GET_BE_U_3(tptr)),
GET_BE_U_3(tptr));
ND_PRINT("\n\t Rejected %s Protocol (0x%04x)",
tok2str(ppptype2str,"unknown", GET_BE_U_2(tptr)),
GET_BE_U_2(tptr));
ND_PRINT("\n\t Rejected %s Protocol (0x%04x)",
tok2str(ppptype2str,"unknown", GET_BE_U_2(tptr)),
GET_BE_U_2(tptr));
ND_PRINT("\n\t Magic-Num 0x%08x", GET_BE_U_4(tptr));
/* XXX: need to decode Data? - hexdump for now */
if (len > 8) {
ND_PRINT("\n\t Magic-Num 0x%08x", GET_BE_U_4(tptr));
/* XXX: need to decode Data? - hexdump for now */
if (len > 8) {
ND_PRINT("\n\t Magic-Num 0x%08x", GET_BE_U_4(tptr));
/* RFC 1661 says this is intended to be human readable */
if (len > 8) {
ND_PRINT("\n\t Magic-Num 0x%08x", GET_BE_U_4(tptr));
/* RFC 1661 says this is intended to be human readable */
if (len > 8) {
ND_PRINT(", Seconds-Remaining %us", GET_BE_U_4(tptr + 4));
/* XXX: need to decode Message? */
break;
ND_PRINT(", Seconds-Remaining %us", GET_BE_U_4(tptr + 4));
/* XXX: need to decode Message? */
break;
ND_PRINT(": Vendor: %s (%u)",
tok2str(oui_values,"Unknown",GET_BE_U_3(p + 2)),
GET_BE_U_3(p + 2));
#if 0
ND_PRINT(": Vendor: %s (%u)",
tok2str(oui_values,"Unknown",GET_BE_U_3(p + 2)),
GET_BE_U_3(p + 2));
#if 0
ND_PRINT(", kind: 0x%02x", GET_U_1(p + 5));
ND_PRINT(", Value: 0x");
for (i = 0; i < len - 6; i++) {
ND_PRINT(", kind: 0x%02x", GET_U_1(p + 5));
ND_PRINT(", Value: 0x");
for (i = 0; i < len - 6; i++) {
ND_PRINT(": %s",
tok2str(ppptype2str, "Unknown Auth Proto (0x04x)", GET_BE_U_2(p + 2)));
switch (GET_BE_U_2(p + 2)) {
case PPP_CHAP:
ND_PRINT(": %s",
tok2str(ppptype2str, "Unknown Auth Proto (0x04x)", GET_BE_U_2(p + 2)));
switch (GET_BE_U_2(p + 2)) {
case PPP_CHAP:
ND_PRINT(": Callback Operation %s (%u)",
tok2str(ppp_callback_values, "Unknown", GET_U_1(p + 2)),
GET_U_1(p + 2));
ND_PRINT(": Callback Operation %s (%u)",
tok2str(ppp_callback_values, "Unknown", GET_U_1(p + 2)),
GET_U_1(p + 2));
code = GET_U_1(p);
ND_PRINT("CHAP, %s (0x%02x)",
tok2str(chapcode_values,"unknown",code),
code);
p++;
code = GET_U_1(p);
ND_PRINT("CHAP, %s (0x%02x)",
tok2str(chapcode_values,"unknown",code),
code);
p++;
val_size = GET_U_1(p); /* value size */
p++;
if (length - (p - p0) < val_size)
return;
ND_PRINT(", Value ");
for (i = 0; i < val_size; i++) {
val_size = GET_U_1(p); /* value size */
p++;
if (length - (p - p0) < val_size)
return;
ND_PRINT(", Value ");
for (i = 0; i < val_size; i++) {
ND_PRINT("%02x", GET_U_1(p));
p++;
}
name_size = len - (u_int)(p - p0);
ND_PRINT(", Name ");
for (i = 0; i < name_size; i++) {
ND_PRINT("%02x", GET_U_1(p));
p++;
}
name_size = len - (u_int)(p - p0);
ND_PRINT(", Name ");
for (i = 0; i < name_size; i++) {
code = GET_U_1(p);
ND_PRINT("PAP, %s (0x%02x)",
tok2str(papcode_values, "unknown", code),
code);
p++;
code = GET_U_1(p);
ND_PRINT("PAP, %s (0x%02x)",
tok2str(papcode_values, "unknown", code),
code);
p++;
peerid_len = GET_U_1(p); /* Peer-ID Length */
p++;
if (length - (p - p0) < peerid_len)
return;
ND_PRINT(", Peer ");
for (i = 0; i < peerid_len; i++) {
peerid_len = GET_U_1(p); /* Peer-ID Length */
p++;
if (length - (p - p0) < peerid_len)
return;
ND_PRINT(", Peer ");
for (i = 0; i < peerid_len; i++) {
fn_print_char(ndo, GET_U_1(p));
p++;
}
if (length - (p - p0) < 1)
return;
fn_print_char(ndo, GET_U_1(p));
p++;
}
if (length - (p - p0) < 1)
return;
passwd_len = GET_U_1(p); /* Password Length */
p++;
if (length - (p - p0) < passwd_len)
return;
ND_PRINT(", Name ");
for (i = 0; i < passwd_len; i++) {
passwd_len = GET_U_1(p); /* Password Length */
p++;
if (length - (p - p0) < passwd_len)
return;
ND_PRINT(", Name ");
for (i = 0; i < passwd_len; i++) {
msg_len = GET_U_1(p); /* Msg-Length */
p++;
if (length - (p - p0) < msg_len)
return;
ND_PRINT(", Msg ");
for (i = 0; i< msg_len; i++) {
msg_len = GET_U_1(p); /* Msg-Length */
p++;
if (length - (p - p0) < msg_len)
return;
ND_PRINT(", Msg ");
for (i = 0; i< msg_len; i++) {
ND_PRINT(": src %s, dst %s",
GET_IPADDR_STRING(p + 2),
GET_IPADDR_STRING(p + 6));
ND_PRINT(": src %s, dst %s",
GET_IPADDR_STRING(p + 2),
GET_IPADDR_STRING(p + 6));
compproto = GET_BE_U_2(p + 2);
ND_PRINT(": %s (0x%02x):",
compproto = GET_BE_U_2(p + 2);
ND_PRINT(": %s (0x%02x):",
ND_PRINT(": Features: %u, PxP: %s, History: %u, #CTX-ID: %u",
(GET_U_1(p + 2) & 0xc0) >> 6,
(GET_U_1(p + 2) & 0x20) ? "Enabled" : "Disabled",
ND_PRINT(": Features: %u, PxP: %s, History: %u, #CTX-ID: %u",
(GET_U_1(p + 2) & 0xc0) >> 6,
(GET_U_1(p + 2) & 0x20) ? "Enabled" : "Disabled",
ND_PRINT(": Window: %uK, Method: %s (0x%x), MBZ: %u, CHK: %u",
(GET_U_1(p + 2) & 0xf0) >> 4,
((GET_U_1(p + 2) & 0x0f) == 8) ? "zlib" : "unknown",
ND_PRINT(": Window: %uK, Method: %s (0x%x), MBZ: %u, CHK: %u",
(GET_U_1(p + 2) & 0xf0) >> 4,
((GET_U_1(p + 2) & 0x0f) == 8) ? "zlib" : "unknown",
ppp_hdlc(netdissect_options *ndo,
const u_char *p, u_int length)
{
ppp_hdlc(netdissect_options *ndo,
const u_char *p, u_int length)
{
- handle_ppp(ndo, proto, b + 4, length - 4);
+ if ((proto & 0xff00) == 0x7e00)
+ ND_PRINT("(protocol 0x%04x invalid)", proto);
+ else
+ handle_ppp(ndo, proto, b + 4, length - 4);
- handle_ppp(ndo, proto, b + 2, length - 2);
+ if ((proto & 0xff00) == 0x7e00)
+ ND_PRINT("(protocol 0x%04x invalid)", proto);
+ else
+ handle_ppp(ndo, proto, b + 2, length - 2);
- if (ndo->ndo_eflag)
- ND_PRINT("%s (0x%04x), length %u: ",
- tok2str(ppptype2str, "unknown", proto),
+ if (ndo->ndo_eflag) {
+ const char *typestr;
+ typestr = tok2str(ppptype2str, "unknown", proto);
+ ND_PRINT("%s (0x%04x), length %u",
+ typestr,
handle_ppp(ndo, proto, p, length);
return (hdr_len);
handle_ppp(ndo, proto, p, length);
return (hdr_len);
ppp_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
ppp_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
ppp_hdlc_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
ppp_hdlc_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{