*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
#ifdef __bsdi__
#include <net/slcompress.h>
#include "chdlc.h"
#include "ethertype.h"
#include "oui.h"
+#include "netdissect-alloc.h"
/*
- * The following constatns are defined by IANA. Please refer to
+ * The following constants are defined by IANA. Please refer to
* http://www.isi.edu/in-notes/iana/assignments/ppp-numbers
* for the up-to-date information.
*/
"PPP-Muxing", /* (30) */
};
-#define NUM_LCPOPTS (sizeof lcpconfopts / sizeof lcpconfopts[0])
+#define NUM_LCPOPTS (sizeof(lcpconfopts) / sizeof(lcpconfopts[0]))
/* ECP - to be supported */
/* RFC 1661 says this is intended to be human readable */
if (len > 8) {
ND_PRINT("\n\t Message\n\t ");
- if (fn_printn(ndo, tptr + 4, len - 4, ndo->ndo_snapend))
+ if (nd_printn(ndo, tptr + 4, len - 4, ndo->ndo_snapend))
goto trunc;
}
break;
ND_PRINT(", Name ");
for (i = 0; i < name_size; i++) {
ND_TCHECK_1(p);
- safeputchar(ndo, EXTRACT_U_1(p));
+ fn_print_char(ndo, EXTRACT_U_1(p));
p++;
}
break;
ND_PRINT(", Msg ");
for (i = 0; i< msg_size; i++) {
ND_TCHECK_1(p);
- safeputchar(ndo, EXTRACT_U_1(p));
+ fn_print_char(ndo, EXTRACT_U_1(p));
p++;
}
break;
ND_PRINT(", Peer ");
for (i = 0; i < peerid_len; i++) {
ND_TCHECK_1(p);
- safeputchar(ndo, EXTRACT_U_1(p));
+ fn_print_char(ndo, EXTRACT_U_1(p));
p++;
}
ND_PRINT(", Name ");
for (i = 0; i < passwd_len; i++) {
ND_TCHECK_1(p);
- safeputchar(ndo, EXTRACT_U_1(p));
+ fn_print_char(ndo, EXTRACT_U_1(p));
p++;
}
break;
ND_PRINT(", Msg ");
for (i = 0; i< msg_len; i++) {
ND_TCHECK_1(p);
- safeputchar(ndo, EXTRACT_U_1(p));
+ fn_print_char(ndo, EXTRACT_U_1(p));
p++;
}
break;
if (length == 0)
return;
- b = (u_char *)malloc(length);
+ b = (u_char *)nd_malloc(ndo, length);
if (b == NULL)
return;
cleanup:
ndo->ndo_snapend = se;
- free(b);
return;
trunc:
ndo->ndo_snapend = se;
- free(b);
- ND_PRINT("[|ppp]");
+ nd_print_trunc(ndo);
}
u_int olen = length; /* _o_riginal length */
u_int hdr_len = 0;
+ ndo->ndo_protocol = "ppp";
/*
* Here, we assume that p points to the Address and Control
* field (if they present).
handle_ppp(ndo, proto, p, length);
return (hdr_len);
trunc:
- ND_PRINT("[|ppp]");
+ nd_print_trunc(ndo);
return (0);
}
u_int length = h->len;
u_int caplen = h->caplen;
+ ndo->ndo_protocol = "ppp_if";
if (caplen < PPP_HDRLEN) {
- ND_PRINT("[|ppp]");
+ nd_print_trunc(ndo);
return (caplen);
}
u_int proto;
u_int hdrlen = 0;
+ ndo->ndo_protocol = "ppp_hdlc_if";
if (caplen < 2) {
- ND_PRINT("[|ppp]");
+ nd_print_trunc(ndo);
return (caplen);
}
case PPP_ADDRESS:
if (caplen < 4 || length < 4) {
- ND_PRINT("[|ppp]");
+ nd_print_trunc(ndo);
return (caplen);
}
default:
if (caplen < 4) {
- ND_PRINT("[|ppp]");
+ nd_print_trunc(ndo);
return (caplen);
}
const u_char *q;
u_int i;
+ ndo->ndo_protocol = "ppp_bsdos_if";
if (caplen < PPP_BSDI_HDRLEN) {
- ND_PRINT("[|ppp]");
+ nd_print_trunc(ndo);
return (caplen);
}
#endif /* __bsdi__ */
return (hdrlength);
}
-
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */