Deleted Added
full compact
print-cdp.c (127668) print-cdp.c (146773)
1/*
2 * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and

--- 12 unchanged lines hidden (view full) ---

21 * Code by Gert Doering, SpaceNet GmbH, gert@space.net
22 *
23 * Reference documentation:
24 * http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
25 */
26
27#ifndef lint
28static const char rcsid[] _U_ =
1/*
2 * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and

--- 12 unchanged lines hidden (view full) ---

21 * Code by Gert Doering, SpaceNet GmbH, gert@space.net
22 *
23 * Reference documentation:
24 * http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
25 */
26
27#ifndef lint
28static const char rcsid[] _U_ =
29 "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.19.2.5 2004/03/24 06:00:51 guy Exp $";
29 "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.25 2004/10/07 14:53:11 hannes Exp $";
30#endif
31
32#ifdef HAVE_CONFIG_H
33#include "config.h"
34#endif
35
36#include <tcpdump-stdinc.h>
37
38#include <stdio.h>
39#include <string.h>
40
41#include "interface.h"
42#include "addrtoname.h"
43#include "extract.h" /* must come after interface.h */
30#endif
31
32#ifdef HAVE_CONFIG_H
33#include "config.h"
34#endif
35
36#include <tcpdump-stdinc.h>
37
38#include <stdio.h>
39#include <string.h>
40
41#include "interface.h"
42#include "addrtoname.h"
43#include "extract.h" /* must come after interface.h */
44#include "nlpid.h"
44
45#define CDP_HEADER_LEN 4
46
47static struct tok cdp_tlv_values[] = {
48 { 0x01, "Device-ID"},
49 { 0x02, "Address"},
50 { 0x03, "Port-ID"},
51 { 0x04, "Capability"},

--- 203 unchanged lines hidden (view full) ---

255 pl = p[1]; /* length of "protocol" field */
256 p += 2;
257
258 TCHECK2(p[pl], 2);
259 if (p + pl + 2 > endp)
260 goto trunc;
261 al = EXTRACT_16BITS(&p[pl]); /* address length */
262
45
46#define CDP_HEADER_LEN 4
47
48static struct tok cdp_tlv_values[] = {
49 { 0x01, "Device-ID"},
50 { 0x02, "Address"},
51 { 0x03, "Port-ID"},
52 { 0x04, "Capability"},

--- 203 unchanged lines hidden (view full) ---

256 pl = p[1]; /* length of "protocol" field */
257 p += 2;
258
259 TCHECK2(p[pl], 2);
260 if (p + pl + 2 > endp)
261 goto trunc;
262 al = EXTRACT_16BITS(&p[pl]); /* address length */
263
263 if (pt == PT_NLPID && pl == 1 && *p == 0xcc && al == 4) {
264 if (pt == PT_NLPID && pl == 1 && *p == NLPID_IP && al == 4) {
264 /*
265 * IPv4: protocol type = NLPID, protocol length = 1
266 * (1-byte NLPID), protocol = 0xcc (NLPID for IPv4),
267 * address length = 4
268 */
269 p += 3;
270
271 TCHECK2(*p, 4);

--- 94 unchanged lines hidden ---
265 /*
266 * IPv4: protocol type = NLPID, protocol length = 1
267 * (1-byte NLPID), protocol = 0xcc (NLPID for IPv4),
268 * address length = 4
269 */
270 p += 3;
271
272 TCHECK2(*p, 4);

--- 94 unchanged lines hidden ---