1 /* EtherApe
2  * Copyright (C) 2000 Juan Toledo, Riccardo Ghetta
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 /* ETHERNET */
19 
20 #ifndef __ETYPES_H__
21 #define __ETYPES_H__
22 
23 typedef enum
24 {
25   ETHERNET_II = 0,
26   ETHERNET_802_2 = 1,
27   ETHERNET_802_3 = 2,
28   ETHERNET_SNAP = 3
29 } ethhdrtype_t;
30 
31 typedef enum
32 {
33   ETHERTYPE_UNK = 0x0000,
34   ETHERTYPE_VINES = 0xbad,
35   ETHERTYPE_TRAIN = 0x1984,
36   ETHERTYPE_3C_NBP_DGRAM = 0x3c07,
37   ETHERTYPE_IP = 0x0800,
38   ETHERTYPE_X25L3 = 0x0805,
39   ETHERTYPE_ARP = 0x0806,
40   ETHERTYPE_DEC = 0x6000,
41   ETHERTYPE_DNA_DL = 0x6001,
42   ETHERTYPE_DNA_RC = 0x6002,
43   ETHERTYPE_DNA_RT = 0x6003,
44   ETHERTYPE_LAT = 0x6004,
45   ETHERTYPE_DEC_DIAG = 0x6005,
46   ETHERTYPE_DEC_CUST = 0x6006,
47   ETHERTYPE_DEC_SCA = 0x6007,
48   ETHERTYPE_ETHBRIDGE = 0x6558, /* transparent Ethernet bridging */
49   ETHERTYPE_DEC_LB = 0x8038,
50   ETHERTYPE_REVARP = 0x8035,
51   ETHERTYPE_ATALK = 0x809b,
52   ETHERTYPE_AARP = 0x80f3,
53   ETHERTYPE_IPX = 0x8137,
54   ETHERTYPE_VLAN = 0x8100,      /* 802.1Q Virtual LAN */
55   ETHERTYPE_SNMP = 0x814c,      /* SNMP over Ethernet, RFC 1089 */
56   ETHERTYPE_WCP = 0x80ff,       /* Wellfleet Compression Protocol */
57   ETHERTYPE_IPv6 = 0x86dd,
58   ETHERTYPE_PPP = 0x880b,       /* no, this is not PPPoE */
59   ETHERTYPE_MPLS = 0x8847,      /* MPLS unicast packet */
60   ETHERTYPE_MPLS_MULTI = 0x8848,        /* MPLS multicast packet */
61   ETHERTYPE_PPPOED = 0x8863,    /* PPPoE Discovery Protocol */
62   ETHERTYPE_PPPOES = 0x8864,    /* PPPoE Session Protocol */
63   ETHERTYPE_LOOP = 0x9000,      /* used for layer 2 testing (do i see my own frames on the wire) */
64 } etype_t;
65 
66 typedef enum
67 {
68   SAP_NULL = 0x00,
69   SAP_LLC_SLMGMT = 0x02,
70   SAP_SNA_PATHCTRL = 0x04,
71   SAP_IP = 0x06,
72   SAP_SNA1 = 0x08,
73   SAP_SNA2 = 0x0C,
74   SAP_PROWAY_NM_INIT = 0x0E,
75   SAP_TI = 0x18,
76   SAP_BPDU = 0x42,
77   SAP_RS511 = 0x4E,
78   SAP_X25 = 0x7E,
79   SAP_XNS = 0x80,
80   SAP_NESTAR = 0x86,
81   SAP_PROWAY_ASLM = 0x8E,
82   SAP_SNAP = 0xAA,
83   SAP_ARP = 0x98,
84   SAP_VINES1 = 0xBA,
85   SAP_VINES2 = 0xBC,
86   SAP_NETWARE = 0xE0,
87   SAP_NETBIOS = 0xF0,
88   SAP_IBMNM = 0xF4,
89   SAP_RPL1 = 0xF8,
90   SAP_UB = 0xFA,
91   SAP_RPL2 = 0xFC,
92   SAP_OSINL = 0xFE,
93   SAP_GLOBAL = 0xFF
94 } sap_type_t;
95 
96 typedef enum
97 {
98   IPX_PACKET_TYPE_IPX = 0,
99   IPX_PACKET_TYPE_RIP = 1,
100   IPX_PACKET_TYPE_ECHO = 2,
101   IPX_PACKET_TYPE_ERROR = 3,
102   IPX_PACKET_TYPE_PEP = 4,
103   IPX_PACKET_TYPE_SPX = 5,
104   IPX_PACKET_TYPE_NCP = 17,
105   IPX_PACKET_TYPE_WANBCAST = 20 /* propagated NetBIOS packet? */
106 } ipx_type_t;
107 
108 typedef enum
109 {
110   IPX_SOCKET_PING_CISCO = 0x0002,       /* In cisco this is set with: ipx ping-default cisco */
111   IPX_SOCKET_NCP = 0x0451,
112   IPX_SOCKET_SAP = 0x0452,
113   IPX_SOCKET_IPXRIP = 0x0453,
114   IPX_SOCKET_NETBIOS = 0x0455,
115   IPX_SOCKET_DIAGNOSTIC = 0x0456,
116   IPX_SOCKET_SERIALIZATION = 0x0457,
117   IPX_SOCKET_NWLINK_SMB_SERVER = 0x0550,
118   IPX_SOCKET_NWLINK_SMB_NAMEQUERY = 0x0551,
119   IPX_SOCKET_NWLINK_SMB_REDIR = 0x0552,
120   IPX_SOCKET_NWLINK_SMB_MAILSLOT = 0x0553,
121   IPX_SOCKET_NWLINK_SMB_MESSENGER = 0x0554,
122   IPX_SOCKET_NWLINK_SMB_BROWSE = 0x0555,        /* ? not sure on this */
123   IPX_SOCKET_ATTACHMATE_GW = 0x055d,
124   IPX_SOCKET_IPX_MESSAGE = 0x4001,
125   IPX_SOCKET_ADSM = 0x8522,     /* www.tivoli.com */
126   IPX_SOCKET_EIGRP = 0x85be,    /* cisco ipx eigrp */
127   IPX_SOCKET_WIDE_AREA_ROUTER = 0x9001,
128   IPX_SOCKET_SNMP_AGENT = 0x900F,       /* RFC 1906 */
129   IPX_SOCKET_SNMP_SINK = 0x9010,        /* RFC 1906 */
130   IPX_SOCKET_PING_NOVELL = 0x9086,      /* In cisco this is set with: ipx ping-default novell */
131   IPX_SOCKET_TCP_TUNNEL = 0x9091,       /* RFC 1791 */
132   IPX_SOCKET_UDP_TUNNEL = 0x9092        /* RFC 1791 */
133 } ipx_socket_t;
134 
135 /* IP */
136 
137 typedef enum
138 {
139   IP_PROTO_HOPOPTS = 0,         /* IP6 hop-by-hop options */
140   IP_PROTO_ICMP = 1,            /* control message protocol */
141   IP_PROTO_IGMP = 2,            /* group mgmt protocol */
142   IP_PROTO_GGP = 3,             /* gateway^2 (deprecated) */
143   IP_PROTO_IPIP = 4,            /* IP inside IP */
144   IP_PROTO_ST = 5,              /* Internet Stream Protocol */
145   IP_PROTO_TCP = 6,             /* tcp */
146   IP_PROTO_CBT = 7,             /* core based trees - RFC2189 */
147   IP_PROTO_EGP = 8,             /* exterior gateway protocol */
148   IP_PROTO_IGP = 9,             /* interior gateway protocol */
149   IP_PROTO_PUP = 12,            /* pup */
150   IP_PROTO_UDP = 17,            /* user datagram protocol */
151   IP_PROTO_IDP = 22,            /* xns idp */
152   IP_PROTO_TP = 29,             /* tp-4 w/ class negotiation */
153   IP_PROTO_IPV6 = 41,           /* IP6 header */
154   IP_PROTO_ROUTING = 43,        /* IP6 routing header */
155   IP_PROTO_FRAGMENT = 44,       /* IP6 fragmentation header */
156   IP_PROTO_RSVP = 46,           /* Resource ReSerVation protocol */
157   IP_PROTO_GRE = 47,            /* GRE */
158   IP_PROTO_ESP = 50,            /* ESP */
159   IP_PROTO_AH = 51,             /* AH */
160   IP_PROTO_ICMPV6 = 58,         /* ICMP6 */
161   IP_PROTO_NONE = 59,           /* IP6 no next header */
162   IP_PROTO_DSTOPTS = 60,        /* IP6 no next header */
163   IP_PROTO_EON = 80,            /* ISO cnlp */
164   IP_PROTO_VINES = 83,          /* Vines over raw IP */
165   IP_PROTO_EIGRP = 88,
166   IP_PROTO_OSPF = 89,
167   IP_PROTO_ENCAP = 98,          /* encapsulation header */
168   IP_PROTO_PIM = 103,           /* Protocol Independent Mcast */
169   IP_PROTO_IPCOMP = 108,        /* IP payload compression */
170   IP_PROTO_VRRP = 112           /* Virtual Router Redundancy Protocol */
171 } iptype_t;
172 
173 typedef guint16 port_type_t;
174 
175 #endif  /* __ETYPES_H__ */
176