/src/PcapPlusPlus/Packet++/header/PPPoELayer.h
Line | Count | Source |
1 | | #pragma once |
2 | | |
3 | | #include "Layer.h" |
4 | | #include "TLVData.h" |
5 | | |
6 | | #include <Layer.h> |
7 | | #include <vector> |
8 | | #include <string.h> |
9 | | |
10 | | /// @file |
11 | | |
12 | | /// @namespace pcpp |
13 | | /// @brief The main namespace for the PcapPlusPlus lib |
14 | | namespace pcpp |
15 | | { |
16 | | /// @struct pppoe_header |
17 | | /// Represents an PPPoE protocol header |
18 | | #pragma pack(push, 1) |
19 | | struct pppoe_header |
20 | | { |
21 | | #if (BYTE_ORDER == LITTLE_ENDIAN) |
22 | | /// PPPoE version |
23 | | uint8_t version : 4; |
24 | | /// PPPoE type |
25 | | uint8_t type : 4; |
26 | | /// PPPoE code |
27 | | uint8_t code; |
28 | | #else |
29 | | /// PPPoE version |
30 | | uint16_t version : 4; |
31 | | /// PPPoE type |
32 | | uint16_t type : 4; |
33 | | /// PPPoE code |
34 | | uint16_t code : 8; |
35 | | #endif |
36 | | /// PPPoE session ID (relevant for PPPoE session packets only) |
37 | | uint16_t sessionId; |
38 | | /// Length (in bytes) of payload, not including the PPPoE header |
39 | | uint16_t payloadLength; |
40 | | }; |
41 | | #pragma pack(pop) |
42 | | static_assert(sizeof(pppoe_header) == 6, "pppoe_header size is not 6 bytes"); |
43 | | |
44 | | /// @class PPPoELayer |
45 | | /// An abstract class that describes the PPPoE protocol. Contains common data and logic of the two types of PPPoE |
46 | | /// packets: PPPoE session and PPPoE discovery |
47 | | class PPPoELayer : public Layer |
48 | | { |
49 | | public: |
50 | | /// PPPoE possible codes |
51 | | enum PPPoECode |
52 | | { |
53 | | /// PPPoE session code |
54 | | PPPOE_CODE_SESSION = 0x00, |
55 | | /// PPPoE discovery PADO |
56 | | PPPOE_CODE_PADO = 0x07, |
57 | | /// PPPoE discovery PADI |
58 | | PPPOE_CODE_PADI = 0x09, |
59 | | /// PPPoE discovery PADG |
60 | | PPPOE_CODE_PADG = 0x0a, |
61 | | /// PPPoE discovery PADC |
62 | | PPPOE_CODE_PADC = 0x0b, |
63 | | /// PPPoE discovery PADQ |
64 | | PPPOE_CODE_PADQ = 0x0c, |
65 | | /// PPPoE discovery PADR |
66 | | PPPOE_CODE_PADR = 0x19, |
67 | | /// PPPoE discovery PADS |
68 | | PPPOE_CODE_PADS = 0x65, |
69 | | /// PPPoE discovery PADT |
70 | | PPPOE_CODE_PADT = 0xa7, |
71 | | /// PPPoE discovery PADM |
72 | | PPPOE_CODE_PADM = 0xd3, |
73 | | /// PPPoE discovery PADN |
74 | | PPPOE_CODE_PADN = 0xd4 |
75 | | }; |
76 | | |
77 | | ~PPPoELayer() override = default; |
78 | | |
79 | | /// Get a pointer to the PPPoE header. Notice this points directly to the data, so every change will change the |
80 | | /// actual packet data |
81 | | /// @return A pointer to the pppoe_header |
82 | | pppoe_header* getPPPoEHeader() const |
83 | 20.4k | { |
84 | 20.4k | return reinterpret_cast<pppoe_header*>(m_Data); |
85 | 20.4k | } |
86 | | |
87 | | // abstract methods implementation |
88 | | |
89 | | /// Calculate @ref pppoe_header#payloadLength field |
90 | | void computeCalculateFields() override; |
91 | | |
92 | | OsiModelLayer getOsiModelLayer() const override |
93 | 9.52k | { |
94 | 9.52k | return OsiModelDataLinkLayer; |
95 | 9.52k | } |
96 | | |
97 | | /// @struct SerializedFields |
98 | | /// Fields written by PPPoELayer's serializeLayer(), in addition to |
99 | | /// Layer::SerializedFields. |
100 | | struct SerializedFields : Layer::SerializedFields |
101 | | { |
102 | | /// @return All field descriptors for PPPoELayer |
103 | | static std::vector<FieldDescriptor> all() |
104 | 0 | { |
105 | 0 | auto result = Layer::SerializedFields::all(); |
106 | 0 | std::initializer_list<FieldDescriptor> extra{ Code, Version, Type, SessionID }; |
107 | 0 | std::copy(extra.begin(), extra.end(), std::back_inserter(result)); |
108 | 0 | return result; |
109 | 0 | } |
110 | | |
111 | | /// @brief Field descriptor for the PPPoE code, written as a number. |
112 | | static const FieldDescriptor Code; |
113 | | |
114 | | /// @brief Field descriptor for the PPPoE version, written as a number. |
115 | | static const FieldDescriptor Version; |
116 | | |
117 | | /// @brief Field descriptor for the PPPoE type, written as a number. |
118 | | static const FieldDescriptor Type; |
119 | | |
120 | | /// @brief Field descriptor for the PPPoE session ID, written as a number in host byte order. |
121 | | static const FieldDescriptor SessionID; |
122 | | |
123 | | /// Maximum field ID used by the layer. |
124 | | static constexpr uint16_t MaxID = Layer::SerializedFields::MaxID + 4; |
125 | | }; |
126 | | |
127 | | protected: |
128 | | // protected c'tor as this class shouldn't be instantiated |
129 | | PPPoELayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet, ProtocolType protocol) |
130 | 83.9k | : Layer(data, dataLen, prevLayer, packet, protocol) |
131 | 83.9k | {} |
132 | | |
133 | | // protected c'tor as this class shouldn't be instantiated |
134 | | PPPoELayer(uint8_t version, uint8_t type, PPPoELayer::PPPoECode code, uint16_t sessionId, |
135 | | size_t additionalBytesToAllocate = 0); |
136 | | |
137 | | void serializeLayer(ObjectScope& serializer) const override; |
138 | | }; |
139 | | |
140 | | /// @class PPPoESessionLayer |
141 | | /// Describes the PPPoE session protocol |
142 | | class PPPoESessionLayer : public PPPoELayer |
143 | | { |
144 | | public: |
145 | | /// A constructor that creates the layer from an existing packet raw data |
146 | | /// @param[in] data A pointer to the raw data (will be casted to @ref pppoe_header) |
147 | | /// @param[in] dataLen Size of the data in bytes |
148 | | /// @param[in] prevLayer A pointer to the previous layer |
149 | | /// @param[in] packet A pointer to the Packet instance where layer will be stored in |
150 | | PPPoESessionLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) |
151 | 77.5k | : PPPoELayer(data, dataLen, prevLayer, packet, PPPoESession) |
152 | 77.5k | {} |
153 | | |
154 | | /// A constructor that allocates a new PPPoE Session header with version, type and session ID |
155 | | /// @param[in] version PPPoE version |
156 | | /// @param[in] type PPPoE type |
157 | | /// @param[in] sessionId PPPoE session ID |
158 | | /// @param[in] pppNextProtocol The next protocol to come after the PPPoE session header. Should be one of the |
159 | | /// PPP_* macros listed below |
160 | | PPPoESessionLayer(uint8_t version, uint8_t type, uint16_t sessionId, uint16_t pppNextProtocol) |
161 | | : PPPoELayer(version, type, PPPoELayer::PPPOE_CODE_SESSION, sessionId, sizeof(uint16_t)) |
162 | 0 | { |
163 | 0 | setPPPNextProtocol(pppNextProtocol); |
164 | 0 | } |
165 | | |
166 | | ~PPPoESessionLayer() override = default; |
167 | | |
168 | | /// @return The protocol after the PPPoE session header. The return value is one of the PPP_* macros listed |
169 | | /// below. This method is also used when parsing a packet (this way we know which layer comes after the PPPoE |
170 | | /// session) |
171 | | uint16_t getPPPNextProtocol() const; |
172 | | |
173 | | /// Set the field that describes which header comes after the PPPoE session header |
174 | | /// @param[in] nextProtocol The protocol value. Should be one of the PPP_* macros listed below |
175 | | void setPPPNextProtocol(uint16_t nextProtocol); |
176 | | |
177 | | /// A static method that validates the input data |
178 | | /// @param[in] data The pointer to the beginning of byte stream of a packet |
179 | | /// @param[in] dataLen The length of the byte stream |
180 | | /// @return True if the data is valid and can represent a PPPoES packet |
181 | | static inline bool isDataValid(const uint8_t* data, size_t dataLen); |
182 | | |
183 | | // abstract methods implementation |
184 | | |
185 | | /// Currently identifies the following next layers: IPv4Layer, IPv6Layer. Otherwise sets PayloadLayer |
186 | | void parseNextLayer() override; |
187 | | |
188 | | /// @return Size of @ref pppoe_header |
189 | | size_t getHeaderLen() const override |
190 | 186k | { |
191 | 186k | return sizeof(pppoe_header) + sizeof(uint16_t); |
192 | 186k | } |
193 | | |
194 | | std::string toString() const override; |
195 | | }; |
196 | | |
197 | | /// @class PPPoEDiscoveryLayer |
198 | | /// Describes the PPPoE discovery protocol |
199 | | class PPPoEDiscoveryLayer : public PPPoELayer |
200 | | { |
201 | | public: |
202 | | /// PPPoE tag types |
203 | | enum PPPoETagTypes |
204 | | { |
205 | | /// End-Of-List tag type |
206 | | PPPOE_TAG_EOL = 0x0000, |
207 | | /// Service-Name tag type |
208 | | PPPOE_TAG_SVC_NAME = 0x0101, |
209 | | /// AC-Name tag type |
210 | | PPPOE_TAG_AC_NAME = 0x0102, |
211 | | /// Host-Uniq tag type |
212 | | PPPOE_TAG_HOST_UNIQ = 0x0103, |
213 | | /// AC-Cookie tag type |
214 | | PPPOE_TAG_AC_COOKIE = 0x0104, |
215 | | /// Vendor-Specific tag type |
216 | | PPPOE_TAG_VENDOR = 0x0105, |
217 | | /// Credits tag type |
218 | | PPPOE_TAG_CREDITS = 0x0106, |
219 | | /// Metrics tag type |
220 | | PPPOE_TAG_METRICS = 0x0107, |
221 | | /// Sequence Number tag type |
222 | | PPPOE_TAG_SEQ_NUM = 0x0108, |
223 | | /// Credit Scale Factor tag type |
224 | | PPPOE_TAG_CRED_SCALE = 0x0109, |
225 | | /// Relay-Session-Id tag type |
226 | | PPPOE_TAG_RELAY_ID = 0x0110, |
227 | | /// HURL tag type |
228 | | PPPOE_TAG_HURL = 0x0111, |
229 | | /// MOTM tag type |
230 | | PPPOE_TAG_MOTM = 0x0112, |
231 | | /// PPP-Max-Payload tag type |
232 | | PPPOE_TAG_MAX_PAYLD = 0x0120, |
233 | | /// IP_Route_Add tag type |
234 | | PPPOE_TAG_IP_RT_ADD = 0x0121, |
235 | | /// Service-Name-Error tag type |
236 | | PPPOE_TAG_SVC_ERR = 0x0201, |
237 | | /// AC-System-Error tag type |
238 | | PPPOE_TAG_AC_ERR = 0x0202, |
239 | | /// Generic-Error tag type |
240 | | PPPOE_TAG_GENERIC_ERR = 0x0203 |
241 | | }; |
242 | | |
243 | | /// @class PPPoETag |
244 | | /// Represents a PPPoE tag and its data |
245 | | class PPPoETag : public TLVRecord<uint16_t, uint16_t> |
246 | | { |
247 | | public: |
248 | | /// A c'tor that gets a pointer to the tag raw data (byte array) |
249 | | /// @param[in] tagRawData A pointer to the tag raw data |
250 | 0 | explicit PPPoETag(uint8_t* tagRawData) : TLVRecord(tagRawData) |
251 | 0 | {} |
252 | | |
253 | | /// A d'tor for this class, currently does nothing |
254 | | ~PPPoETag() override = default; |
255 | | |
256 | | /// @return The tag type converted to PPPoEDiscoveryLayer#PPPoETagTypes enum |
257 | | PPPoEDiscoveryLayer::PPPoETagTypes getType() const; |
258 | | |
259 | | /// Retrieve the tag data as string. Relevant only if the tag value is indeed a string |
260 | | /// @return The tag data as string |
261 | | std::string getValueAsString() const |
262 | 0 | { |
263 | 0 | size_t dataSize = getDataSize(); |
264 | 0 | if (dataSize < 1) |
265 | 0 | return ""; |
266 | 0 |
|
267 | 0 | return std::string(reinterpret_cast<const char*>(m_Data->recordValue), dataSize); |
268 | 0 | } |
269 | | |
270 | | // implement abstract methods |
271 | | |
272 | | size_t getTotalSize() const override; |
273 | | |
274 | | size_t getDataSize() const override; |
275 | | }; |
276 | | |
277 | | /// @class PPPoETagBuilder |
278 | | /// A class for building PPPoE Tags. This builder receives the tag parameters in its c'tor, |
279 | | /// builds the PPPoE Tag raw buffer and provides a build() method to get a PPPoETag object out of it |
280 | | class PPPoETagBuilder : public TLVRecordBuilder |
281 | | { |
282 | | public: |
283 | | /// A c'tor for building a PPPoE Tag which has no value (tag len is zero). The PPPoETag object can later |
284 | | /// be retrieved by calling build() |
285 | | /// @param[in] tagType Tag type |
286 | | explicit PPPoETagBuilder(PPPoETagTypes tagType) |
287 | | : TLVRecordBuilder(static_cast<uint16_t>(tagType), nullptr, 0) |
288 | 0 | {} |
289 | | |
290 | | /// A c'tor for building a PPPoE Tag which has a 4-byte value. The PPPoETag object can later |
291 | | /// be retrieved by calling build() |
292 | | /// @param[in] tagType Tag type |
293 | | /// @param[in] tagValue The tag's 4-byte value |
294 | | PPPoETagBuilder(PPPoETagTypes tagType, uint32_t tagValue) |
295 | | : TLVRecordBuilder(static_cast<uint16_t>(tagType), tagValue) |
296 | 0 | {} |
297 | | |
298 | | /// A c'tor for building a PPPoE Tag which has some arbitrary value. The PPPoETag object can later |
299 | | /// be retrieved by calling build() |
300 | | /// @param[in] tagType Tag type |
301 | | /// @param[in] tagValue A byte array that contains the tag data |
302 | | /// @param[in] tagValueLen The length of the value byte array |
303 | | PPPoETagBuilder(PPPoETagTypes tagType, uint8_t* tagValue, uint8_t tagValueLen) |
304 | | : TLVRecordBuilder(static_cast<uint16_t>(tagType), tagValue, tagValueLen) |
305 | 0 | {} |
306 | | |
307 | | /// Build the PPPoETag object out of the parameters defined in the c'tor |
308 | | /// @return The PPPoETag object |
309 | | PPPoETag build() const; |
310 | | }; |
311 | | |
312 | | /// A constructor that creates the layer from an existing packet raw data |
313 | | /// @param[in] data A pointer to the raw data (will be casted to @ref pppoe_header) |
314 | | /// @param[in] dataLen Size of the data in bytes |
315 | | /// @param[in] prevLayer A pointer to the previous layer |
316 | | /// @param[in] packet A pointer to the Packet instance where layer will be stored in |
317 | | PPPoEDiscoveryLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) |
318 | 6.38k | : PPPoELayer(data, dataLen, prevLayer, packet, PPPoEDiscovery) |
319 | 6.38k | { |
320 | 6.38k | m_DataLen = getHeaderLen(); |
321 | 6.38k | } |
322 | | |
323 | | /// A constructor that allocates a new PPPoE Discovery header with version, type, PPPoE code and session ID |
324 | | /// @param[in] version PPPoE version |
325 | | /// @param[in] type PPPoE type |
326 | | /// @param[in] code PPPoE code enum |
327 | | /// @param[in] sessionId PPPoE session ID |
328 | | PPPoEDiscoveryLayer(uint8_t version, uint8_t type, PPPoELayer::PPPoECode code, uint16_t sessionId) |
329 | | : PPPoELayer(version, type, code, sessionId) |
330 | 0 | { |
331 | 0 | m_Protocol = PPPoEDiscovery; |
332 | 0 | } |
333 | | |
334 | | /// Get a PPPoE Tag by tag type. |
335 | | /// @param[in] tagType The type of the tag to search |
336 | | /// @return A PPPoETag object that contains the first tag that matches this type, or logical null |
337 | | /// (PPPoETag#isNull() == true) if no such tag found |
338 | | PPPoETag getTag(PPPoEDiscoveryLayer::PPPoETagTypes tagType) const; |
339 | | |
340 | | /// @return The first tag in the PPPoE discovery layer. If the current layer contains no tags the returned value |
341 | | /// will contain a logical null (PPPoETag#isNull() == true) |
342 | | PPPoETag getFirstTag() const; |
343 | | |
344 | | /// Get the tag that comes right after the "tag" parameter. If the given tag is the last one, the returned value |
345 | | /// will contain a logical null (PPPoETag#isNull() == true) |
346 | | /// @param[in] tag A given tag |
347 | | /// @return A PPPoETag object containing the tag that comes next, or logical null if the given |
348 | | /// tag: (1) was the last one; (2) contains a logical null or (3) doesn't belong to this packet |
349 | | PPPoETag getNextTag(const PPPoETag& tag) const; |
350 | | |
351 | | /// @return The number of tags in this layer |
352 | | int getTagCount() const; |
353 | | |
354 | | /// Add a new PPPoE Tag at the end of the layer |
355 | | /// @param[in] tagBuilder A PPPoETagBuilder object that contains the requested tag data to add |
356 | | /// @return A PPPoETag object containing the newly added PPPoE Tag data or logical null |
357 | | /// (PPPoETag#isNull() == true) if addition failed |
358 | | PPPoETag addTag(const PPPoETagBuilder& tagBuilder); |
359 | | |
360 | | /// Add a new PPPoE Tag after an existing one |
361 | | /// @param[in] tagBuilder A PPPoETagBuilder object that contains the requested tag data to add |
362 | | /// @param[in] prevTagType The PPPoE Tag which the newly added tag will come after |
363 | | /// @return A PPPoETag object containing the newly added PPPoE Tag data or logical null |
364 | | /// (PPPoETag#isNull() == true) if addition failed |
365 | | PPPoETag addTagAfter(const PPPoETagBuilder& tagBuilder, PPPoETagTypes prevTagType); |
366 | | |
367 | | /// Remove an existing tag. Tag will be found by the tag type |
368 | | /// @param[in] tagType The tag type to remove |
369 | | /// @return True if tag was removed or false if tag wasn't found or if tag removal failed (in each case a proper |
370 | | /// error will be written to log) |
371 | | bool removeTag(PPPoEDiscoveryLayer::PPPoETagTypes tagType); |
372 | | |
373 | | /// Remove all tags in this layer |
374 | | /// @return True if all tags were successfully or false if removal failed for some reason (a proper error will |
375 | | /// be written to log) |
376 | | bool removeAllTags(); |
377 | | |
378 | | /// A static method that validates the input data |
379 | | /// @param[in] data The pointer to the beginning of byte stream of a packet |
380 | | /// @param[in] dataLen The length of the byte stream |
381 | | /// @return True if the data is valid and can represent a PPPoED packet |
382 | | static inline bool isDataValid(const uint8_t* data, size_t dataLen); |
383 | | |
384 | | // abstract methods implementation |
385 | | |
386 | | /// Does nothing for this layer (PPPoE discovery is always the last layer) |
387 | | void parseNextLayer() override |
388 | 6.38k | {} |
389 | | |
390 | | /// @return The header length which is size of strcut pppoe_header plus the total size of tags |
391 | | size_t getHeaderLen() const override; |
392 | | |
393 | | std::string toString() const override |
394 | 3.02k | { |
395 | 3.02k | return "PPP-over-Ethernet Discovery (" + codeToString((PPPoELayer::PPPoECode)getPPPoEHeader()->code) + ")"; |
396 | 3.02k | } |
397 | | |
398 | | /// @struct SerializedFields |
399 | | /// Fields written by PPPoEDiscoveryLayer's serializeLayer(), in addition to |
400 | | /// PPPoELayer::SerializedFields. |
401 | | struct SerializedFields : PPPoELayer::SerializedFields |
402 | | { |
403 | | /// @return All field descriptors for PPPoEDiscoveryLayer |
404 | | static std::vector<FieldDescriptor> all() |
405 | 0 | { |
406 | 0 | auto result = PPPoELayer::SerializedFields::all(); |
407 | 0 | std::initializer_list<FieldDescriptor> extra{ Tags }; |
408 | 0 | std::copy(extra.begin(), extra.end(), std::back_inserter(result)); |
409 | 0 | return result; |
410 | 0 | } |
411 | | |
412 | | /// @brief Field descriptor for the array of PPPoE tags found in the layer. |
413 | | static const FieldDescriptor Tags; |
414 | | |
415 | | /// @brief Field descriptor for a single entry of the Tags array, written as the tag type name |
416 | | /// (e.g. "PPPOE_TAG_SVC_NAME"). |
417 | | static const FieldDescriptor Tag; |
418 | | }; |
419 | | |
420 | | protected: |
421 | | void serializeLayer(ObjectScope& serializer) const override; |
422 | | |
423 | | private: |
424 | | TLVRecordReader<PPPoETag> m_TagReader; |
425 | | |
426 | | PPPoETag addTagAt(const PPPoETagBuilder& tagBuilder, int offset); |
427 | | |
428 | | uint8_t* getTagBasePtr() const |
429 | 0 | { |
430 | 0 | return m_Data + sizeof(pppoe_header); |
431 | 0 | } |
432 | | |
433 | | std::string codeToString(PPPoECode code) const; |
434 | | }; |
435 | | |
436 | | // implementation of inline methods |
437 | | |
438 | | bool PPPoESessionLayer::isDataValid(const uint8_t* data, size_t dataLen) |
439 | 77.7k | { |
440 | 77.7k | return data && dataLen >= sizeof(pppoe_header) + sizeof(uint16_t); |
441 | 77.7k | } |
442 | | |
443 | | bool PPPoEDiscoveryLayer::isDataValid(const uint8_t* data, size_t dataLen) |
444 | 6.38k | { |
445 | 6.38k | return data && dataLen >= sizeof(pppoe_header); |
446 | 6.38k | } |
447 | | |
448 | | // Copied from Wireshark: ppptypes.h |
449 | | |
450 | | /// Padding Protocol |
451 | 10 | #define PCPP_PPP_PADDING 0x1 |
452 | | /// ROHC small-CID |
453 | 10 | #define PCPP_PPP_ROHC_SCID 0x3 |
454 | | /// ROHC large-CID |
455 | 10 | #define PCPP_PPP_ROHC_LCID 0x5 |
456 | | /// Internet Protocol version 4 |
457 | 158k | #define PCPP_PPP_IP 0x21 |
458 | | /// OSI Network Layer |
459 | 10 | #define PCPP_PPP_OSI 0x23 |
460 | | /// Xerox NS IDP |
461 | 10 | #define PCPP_PPP_XNSIDP 0x25 |
462 | | /// DECnet Phase IV |
463 | 10 | #define PCPP_PPP_DEC4 0x27 |
464 | | /// AppleTalk |
465 | 10 | #define PCPP_PPP_AT 0x29 |
466 | | /// Novell IPX |
467 | 10 | #define PCPP_PPP_IPX 0x2b |
468 | | /// Van Jacobson Compressed TCP/IP |
469 | 10 | #define PCPP_PPP_VJC_COMP 0x2d |
470 | | /// Van Jacobson Uncompressed TCP/IP |
471 | 10 | #define PCPP_PPP_VJC_UNCOMP 0x2f |
472 | | /// Bridging PDU |
473 | 10 | #define PCPP_PPP_BCP 0x31 |
474 | | /// Stream Protocol (ST-II) |
475 | 10 | #define PCPP_PPP_ST 0x33 |
476 | | /// Banyan Vines |
477 | 10 | #define PCPP_PPP_VINES 0x35 |
478 | | /// AppleTalk EDDP |
479 | 10 | #define PCPP_PPP_AT_EDDP 0x39 |
480 | | /// AppleTalk SmartBuffered |
481 | 10 | #define PCPP_PPP_AT_SB 0x3b |
482 | | /// Multi-Link |
483 | 10 | #define PCPP_PPP_MP 0x3d |
484 | | /// NETBIOS Framing |
485 | 10 | #define PCPP_PPP_NB 0x3f |
486 | | /// Cisco Systems |
487 | 10 | #define PCPP_PPP_CISCO 0x41 |
488 | | /// Ascom Timeplex |
489 | 10 | #define PCPP_PPP_ASCOM 0x43 |
490 | | /// Fujitsu Link Backup and Load Balancing |
491 | 10 | #define PCPP_PPP_LBLB 0x45 |
492 | | /// DCA Remote Lan |
493 | 10 | #define PCPP_PPP_RL 0x47 |
494 | | /// Serial Data Transport Protocol |
495 | 10 | #define PCPP_PPP_SDTP 0x49 |
496 | | /// SNA over 802.2 |
497 | 10 | #define PCPP_PPP_LLC 0x4b |
498 | | /// SNA |
499 | 10 | #define PCPP_PPP_SNA 0x4d |
500 | | /// IPv6 Header Compression |
501 | 10 | #define PCPP_PPP_IPV6HC 0x4f |
502 | | /// KNX Bridging Data |
503 | 10 | #define PCPP_PPP_KNX 0x51 |
504 | | /// Encryption |
505 | 10 | #define PCPP_PPP_ENCRYPT 0x53 |
506 | | /// Individual Link Encryption |
507 | 10 | #define PCPP_PPP_ILE 0x55 |
508 | | /// Internet Protocol version 6 |
509 | 3.71k | #define PCPP_PPP_IPV6 0x57 |
510 | | /// PPP Muxing |
511 | 10 | #define PCPP_PPP_MUX 0x59 |
512 | | /// Vendor-Specific Network Protocol (VSNP) |
513 | 10 | #define PCPP_PPP_VSNP 0x5b |
514 | | /// TRILL Network Protocol (TNP) |
515 | 10 | #define PCPP_PPP_TNP 0x5d |
516 | | /// RTP IPHC Full Header |
517 | 10 | #define PCPP_PPP_RTP_FH 0x61 |
518 | | /// RTP IPHC Compressed TCP |
519 | 10 | #define PCPP_PPP_RTP_CTCP 0x63 |
520 | | /// RTP IPHC Compressed Non TCP |
521 | 10 | #define PCPP_PPP_RTP_CNTCP 0x65 |
522 | | /// RTP IPHC Compressed UDP 8 |
523 | 10 | #define PCPP_PPP_RTP_CUDP8 0x67 |
524 | | /// RTP IPHC Compressed RTP 8 |
525 | 10 | #define PCPP_PPP_RTP_CRTP8 0x69 |
526 | | /// Stampede Bridging |
527 | 10 | #define PCPP_PPP_STAMPEDE 0x6f |
528 | | /// MP+ Protocol |
529 | 10 | #define PCPP_PPP_MPPLUS 0x73 |
530 | | /// NTCITS IPI |
531 | 10 | #define PCPP_PPP_NTCITS_IPI 0xc1 |
532 | | /// Single link compression in multilink |
533 | 10 | #define PCPP_PPP_ML_SLCOMP 0xfb |
534 | | /// Compressed datagram |
535 | 10 | #define PCPP_PPP_COMP 0xfd |
536 | | /// 802.1d Hello Packets |
537 | 10 | #define PCPP_PPP_STP_HELLO 0x0201 |
538 | | /// IBM Source Routing BPDU |
539 | 10 | #define PCPP_PPP_IBM_SR 0x0203 |
540 | | /// DEC LANBridge100 Spanning Tree |
541 | 10 | #define PCPP_PPP_DEC_LB 0x0205 |
542 | | /// Cisco Discovery Protocol |
543 | 10 | #define PCPP_PPP_CDP 0x0207 |
544 | | /// Netcs Twin Routing |
545 | 10 | #define PCPP_PPP_NETCS 0x0209 |
546 | | /// STP - Scheduled Transfer Protocol |
547 | 10 | #define PCPP_PPP_STP 0x020b |
548 | | /// EDP - Extreme Discovery Protocol |
549 | 10 | #define PCPP_PPP_EDP 0x020d |
550 | | /// Optical Supervisory Channel Protocol |
551 | 10 | #define PCPP_PPP_OSCP 0x0211 |
552 | | /// Optical Supervisory Channel Protocol |
553 | 10 | #define PCPP_PPP_OSCP2 0x0213 |
554 | | /// Luxcom |
555 | 10 | #define PCPP_PPP_LUXCOM 0x0231 |
556 | | /// Sigma Network Systems |
557 | 10 | #define PCPP_PPP_SIGMA 0x0233 |
558 | | /// Apple Client Server Protocol |
559 | 10 | #define PCPP_PPP_ACSP 0x0235 |
560 | | /// MPLS Unicast |
561 | 10 | #define PCPP_PPP_MPLS_UNI 0x0281 |
562 | | /// MPLS Multicast |
563 | 10 | #define PCPP_PPP_MPLS_MULTI 0x0283 |
564 | | /// IEEE p1284.4 standard - data packets |
565 | 10 | #define PCPP_PPP_P12844 0x0285 |
566 | | /// ETSI TETRA Network Protocol Type 1 |
567 | 10 | #define PCPP_PPP_TETRA 0x0287 |
568 | | /// Multichannel Flow Treatment Protocol |
569 | 10 | #define PCPP_PPP_MFTP 0x0289 |
570 | | /// RTP IPHC Compressed TCP No Delta |
571 | 10 | #define PCPP_PPP_RTP_CTCPND 0x2063 |
572 | | /// RTP IPHC Context State |
573 | 10 | #define PCPP_PPP_RTP_CS 0x2065 |
574 | | /// RTP IPHC Compressed UDP 16 |
575 | 10 | #define PCPP_PPP_RTP_CUDP16 0x2067 |
576 | | /// RTP IPHC Compressed RTP 16 |
577 | 10 | #define PCPP_PPP_RTP_CRDP16 0x2069 |
578 | | /// Cray Communications Control Protocol |
579 | 10 | #define PCPP_PPP_CCCP 0x4001 |
580 | | /// CDPD Mobile Network Registration Protocol |
581 | 10 | #define PCPP_PPP_CDPD_MNRP 0x4003 |
582 | | /// Expand accelerator protocol |
583 | 10 | #define PCPP_PPP_EXPANDAP 0x4005 |
584 | | /// ODSICP NCP |
585 | 10 | #define PCPP_PPP_ODSICP 0x4007 |
586 | | /// DOCSIS DLL |
587 | 10 | #define PCPP_PPP_DOCSIS 0x4009 |
588 | | /// Cetacean Network Detection Protocol |
589 | 10 | #define PCPP_PPP_CETACEANNDP 0x400b |
590 | | /// Stacker LZS |
591 | 10 | #define PCPP_PPP_LZS 0x4021 |
592 | | /// RefTek Protocol |
593 | 10 | #define PCPP_PPP_REFTEK 0x4023 |
594 | | /// Fibre Channel |
595 | 10 | #define PCPP_PPP_FC 0x4025 |
596 | | /// EMIT Protocols |
597 | 10 | #define PCPP_PPP_EMIT 0x4027 |
598 | | /// Vendor-Specific Protocol (VSP) |
599 | 10 | #define PCPP_PPP_VSP 0x405b |
600 | | /// TRILL Link State Protocol (TLSP) |
601 | 10 | #define PCPP_PPP_TLSP 0x405d |
602 | | /// Internet Protocol Control Protocol |
603 | 10 | #define PCPP_PPP_IPCP 0x8021 |
604 | | /// OSI Network Layer Control Protocol |
605 | 10 | #define PCPP_PPP_OSINLCP 0x8023 |
606 | | /// Xerox NS IDP Control Protocol |
607 | 10 | #define PCPP_PPP_XNSIDPCP 0x8025 |
608 | | /// DECnet Phase IV Control Protocol |
609 | 10 | #define PCPP_PPP_DECNETCP 0x8027 |
610 | | /// AppleTalk Control Protocol |
611 | 10 | #define PCPP_PPP_ATCP 0x8029 |
612 | | /// Novell IPX Control Protocol |
613 | 10 | #define PCPP_PPP_IPXCP 0x802b |
614 | | /// Bridging NCP |
615 | 10 | #define PCPP_PPP_BRIDGENCP 0x8031 |
616 | | /// Stream Protocol Control Protocol |
617 | 10 | #define PCPP_PPP_SPCP 0x8033 |
618 | | /// Banyan Vines Control Protocol |
619 | 10 | #define PCPP_PPP_BVCP 0x8035 |
620 | | /// Multi-Link Control Protocol |
621 | 10 | #define PCPP_PPP_MLCP 0x803d |
622 | | /// NETBIOS Framing Control Protocol |
623 | 10 | #define PCPP_PPP_NBCP 0x803f |
624 | | /// Cisco Systems Control Protocol |
625 | 10 | #define PCPP_PPP_CISCOCP 0x8041 |
626 | | /// Ascom Timeplex Control Protocol (?) |
627 | 10 | #define PCPP_PPP_ASCOMCP 0x8043 |
628 | | /// Fujitsu LBLB Control Protocol |
629 | 10 | #define PCPP_PPP_LBLBCP 0x8045 |
630 | | /// DCA Remote Lan Network Control Protocol |
631 | 10 | #define PCPP_PPP_RLNCP 0x8047 |
632 | | /// Serial Data Control Protocol |
633 | 10 | #define PCPP_PPP_SDCP 0x8049 |
634 | | /// SNA over 802.2 Control Protocol |
635 | 10 | #define PCPP_PPP_LLCCP 0x804b |
636 | | /// SNA Control Protocol |
637 | 10 | #define PCPP_PPP_SNACP 0x804d |
638 | | /// IP6 Header Compression Control Protocol |
639 | 10 | #define PCPP_PPP_IP6HCCP 0x804f |
640 | | /// KNX Bridging Control Protocol |
641 | 10 | #define PCPP_PPP_KNXCP 0x8051 |
642 | | /// Encryption Control Protocol |
643 | 10 | #define PCPP_PPP_ECP 0x8053 |
644 | | /// Individual Link Encryption Control Protocol |
645 | 10 | #define PCPP_PPP_ILECP 0x8055 |
646 | | /// IPv6 Control Protocol |
647 | 10 | #define PCPP_PPP_IPV6CP 0x8057 |
648 | | /// PPP Muxing Control Protocol |
649 | 10 | #define PCPP_PPP_MUXCP 0x8059 |
650 | | /// Vendor-Specific Network Control Protocol (VSNCP) [RFC3772] |
651 | 10 | #define PCPP_PPP_VSNCP 0x805b |
652 | | /// TRILL Network Control Protocol (TNCP) |
653 | 10 | #define PCPP_PPP_TNCP 0x805d |
654 | | /// Stampede Bridging Control Protocol |
655 | 10 | #define PCPP_PPP_STAMPEDECP 0x806f |
656 | | /// MP+ Contorol Protocol |
657 | 10 | #define PCPP_PPP_MPPCP 0x8073 |
658 | | /// NTCITS IPI Control Protocol |
659 | 10 | #define PCPP_PPP_IPICP 0x80c1 |
660 | | /// Single link compression in multilink control |
661 | 10 | #define PCPP_PPP_SLCC 0x80fb |
662 | | /// Compression Control Protocol |
663 | 10 | #define PCPP_PPP_CCP 0x80fd |
664 | | /// Cisco Discovery Protocol Control Protocol |
665 | 10 | #define PCPP_PPP_CDPCP 0x8207 |
666 | | /// Netcs Twin Routing |
667 | 10 | #define PCPP_PPP_NETCSCP 0x8209 |
668 | | /// STP - Control Protocol |
669 | 10 | #define PCPP_PPP_STPCP 0x820b |
670 | | /// EDPCP - Extreme Discovery Protocol Control Protocol |
671 | 10 | #define PCPP_PPP_EDPCP 0x820d |
672 | | /// Apple Client Server Protocol Control |
673 | 10 | #define PCPP_PPP_ACSPC 0x8235 |
674 | | /// MPLS Control Protocol |
675 | 10 | #define PCPP_PPP_MPLSCP 0x8281 |
676 | | /// IEEE p1284.4 standard - Protocol Control |
677 | 10 | #define PCPP_PPP_P12844CP 0x8285 |
678 | | /// ETSI TETRA TNP1 Control Protocol |
679 | 10 | #define PCPP_PPP_TETRACP 0x8287 |
680 | | /// Multichannel Flow Treatment Protocol |
681 | 10 | #define PCPP_PPP_MFTPCP 0x8289 |
682 | | /// Link Control Protocol |
683 | 10 | #define PCPP_PPP_LCP 0xc021 |
684 | | /// Password Authentication Protocol |
685 | 10 | #define PCPP_PPP_PAP 0xc023 |
686 | | /// Link Quality Report |
687 | 10 | #define PCPP_PPP_LQR 0xc025 |
688 | | /// Shiva Password Authentication Protocol |
689 | 10 | #define PCPP_PPP_SPAP 0xc027 |
690 | | /// CallBack Control Protocol (CBCP) |
691 | 10 | #define PCPP_PPP_CBCP 0xc029 |
692 | | /// BACP Bandwidth Allocation Control Protocol |
693 | 10 | #define PCPP_PPP_BACP 0xc02b |
694 | | /// BAP Bandwidth Allocation Protocol |
695 | 10 | #define PCPP_PPP_BAP 0xc02d |
696 | | /// Vendor-Specific Authentication Protocol (VSAP) |
697 | 10 | #define PCPP_PPP_VSAP 0xc05b |
698 | | /// Container Control Protocol |
699 | 10 | #define PCPP_PPP_CONTCP 0xc081 |
700 | | /// Challenge Handshake Authentication Protocol |
701 | 10 | #define PCPP_PPP_CHAP 0xc223 |
702 | | /// RSA Authentication Protocol |
703 | 10 | #define PCPP_PPP_RSAAP 0xc225 |
704 | | /// Extensible Authentication Protocol |
705 | 10 | #define PCPP_PPP_EAP 0xc227 |
706 | | /// Mitsubishi Security Information Exchange Protocol (SIEP) |
707 | 10 | #define PCPP_PPP_SIEP 0xc229 |
708 | | /// Stampede Bridging Authorization Protocol |
709 | 10 | #define PCPP_PPP_SBAP 0xc26f |
710 | | /// Proprietary Authentication Protocol |
711 | 10 | #define PCPP_PPP_PRPAP 0xc281 |
712 | | /// Proprietary Authentication Protocol |
713 | 10 | #define PCPP_PPP_PRPAP2 0xc283 |
714 | | /// Proprietary Node ID Authentication Protocol |
715 | 10 | #define PCPP_PPP_PRPNIAP 0xc481 |
716 | | |
717 | | } // namespace pcpp |