]> git.ipfire.org Git - thirdparty/lldpd.git/blob - src/daemon/cdp.h
Separate daemon and client code. Provide a client library.
[thirdparty/lldpd.git] / src / daemon / cdp.h
1 /* -*- mode: c; c-file-style: "openbsd" -*- */
2 /*
3 * Copyright (c) 2008 Vincent Bernat <bernat@luffy.cx>
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18 #ifndef _CDP_H
19 #define _CDP_H
20
21 #define CDP_MULTICAST_ADDR { \
22 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc \
23 }
24 #define FDP_MULTICAST_ADDR { \
25 0x01, 0xe0, 0x52, 0xcc, 0xcc, 0xcc, \
26 }
27 #define LLC_ORG_CISCO { 0x00, 0x00, 0x0c }
28 #define LLC_ORG_FOUNDRY { 0x00, 0xe0, 0x52 }
29 #define LLC_PID_CDP 0x2000
30 /* Other protocols */
31 #define LLC_PID_DRIP 0x102
32 #define LLC_PID_PAGP 0x104
33 #define LLC_PID_PVSTP 0x10b
34 #define LLC_PID_UDLD 0x111
35 #define LLC_PID_VTP 0x2003
36 #define LLC_PID_DTP 0x2004
37 #define LLC_PID_STP 0x200a
38
39 enum {
40 CDP_TLV_CHASSIS = 1,
41 CDP_TLV_ADDRESSES = 2,
42 CDP_TLV_PORT = 3,
43 CDP_TLV_CAPABILITIES = 4,
44 CDP_TLV_SOFTWARE = 5,
45 CDP_TLV_PLATFORM = 6,
46 CDP_TLV_NATIVEVLAN = 10
47 };
48
49 #define CDP_ADDRESS_PROTO_IP 0xcc
50
51 #define CDP_CAP_ROUTER 0x01
52 #define CDP_CAP_TRANSPARENT_BRIDGE 0x02
53 #define CDP_CAP_SOURCE_BRIDGE 0x04
54 #define CDP_CAP_SWITCH 0x08
55 #define CDP_CAP_HOST 0x10
56 #define CDP_CAP_IGMP 0x20
57 #define CDP_CAP_REPEATER 0x40
58
59 #endif /* _CDP_H */
60