* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * L2TP support contributed by Motonori Shindo (mshindo@ascend.co.jp)
+ * L2TP support contributed by Motonori Shindo (mshindo@mshindo.net)
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.6 1999-12-22 06:27:21 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.7 2000-07-01 03:48:44 assar Exp $";
#endif
#ifdef HAVE_CONFIG_H
static void
l2tp_tie_breaker_print(const u_char *dat, u_int length)
{
- printf("%lx", *(u_long *)dat); /* XXX */
+ print_octets(dat, 8); /* Tie Break Value is 64bits long */
}
static void
}
ptr++;
- if (ntohs(*ptr)) { /* IETF == 0 */
- printf("vendor=%04x", ntohs(*ptr));
- }
- ptr++;
-
- if (ntohs(*ptr) < L2TP_MAX_AVP_INDEX) {
- printf("%s", l2tp_avp[ntohs(*ptr)].name);
+ if (ntohs(*ptr)) {
+ /* Vendor Specific Attribute */
+ printf("VENDOR%04x:", ntohs(*ptr));
+ ptr++;
+ printf("ATTR%04x", ntohs(*ptr));
printf("(");
- if (!hidden) {
- (l2tp_avp[ntohs(*ptr)].print)
- ((u_char *)ptr+2, len-6);
- } else {
- printf("???");
- }
+ print_octets((u_char *)ptr+2, len-6);
printf(")");
} else {
- printf(" invalid AVP %u", ntohs(*ptr));
+ /* IETF-defined Attribute */
+ ptr++;
+ if (ntohs(*ptr) < L2TP_MAX_AVP_INDEX) {
+ printf("%s", l2tp_avp[ntohs(*ptr)].name);
+ printf("(");
+ if (!hidden) {
+ (l2tp_avp[ntohs(*ptr)].print)
+ ((u_char *)ptr+2, len-6);
+ } else {
+ printf("???");
+ }
+ printf(")");
+ } else {
+ printf(" invalid AVP %u", ntohs(*ptr));
+ }
}
l2tp_avp_print(dat + len, length - len);