suricata
decode-pppoe.h
Go to the documentation of this file.
1
/* Copyright (C) 2007-2010 Open Information Security Foundation
2
*
3
* You can copy, redistribute or modify this Program under the terms of
4
* the GNU General Public License version 2 as published by the Free
5
* Software Foundation.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* version 2 along with this program; if not, write to the Free Software
14
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15
* 02110-1301, USA.
16
*/
17
18
/**
19
* \file
20
*
21
* \author James Riden <jamesr@europe.com>
22
*/
23
24
#ifndef SURICATA_DECODE_PPPOE_H
25
#define SURICATA_DECODE_PPPOE_H
26
27
// Session header length minus the protocol field
28
#define PPPOE_SESSION_HEADER_MIN_LEN 7
29
#define PPPOE_DISCOVERY_HEADER_MIN_LEN 6
30
#define PPPOE_SESSION_GET_VERSION(hdr) ((hdr)->pppoe_version_type & 0xF0) >> 4
31
#define PPPOE_SESSION_GET_TYPE(hdr) ((hdr)->pppoe_version_type & 0x0F)
32
#define PPPOE_DISCOVERY_GET_VERSION(hdr) ((hdr)->pppoe_version_type & 0xF0) >> 4
33
#define PPPOE_DISCOVERY_GET_TYPE(hdr) ((hdr)->pppoe_version_type & 0x0F)
34
35
typedef
struct
PPPOESessionHdr_
{
36
uint8_t
pppoe_version_type
;
37
uint8_t
pppoe_code
;
38
uint16_t
session_id
;
39
uint16_t
pppoe_length
;
40
uint16_t
protocol
;
41
}
PPPOESessionHdr
;
42
43
typedef
struct
PPPOEDiscoveryTag_
{
44
uint16_t
pppoe_tag_type
;
45
uint16_t
pppoe_tag_length
;
46
}
__attribute__
((__packed__)) PPPOEDiscoveryTag;
47
48
typedef
struct
PPPOEDiscoveryHdr_
{
49
uint8_t
pppoe_version_type
;
50
uint8_t
pppoe_code
;
51
uint16_t
discovery_id
;
52
uint16_t
pppoe_length
;
53
}
__attribute__
((__packed__)) PPPOEDiscoveryHdr;
54
55
/* see RFC 2516 - discovery codes */
56
#define PPPOE_CODE_PADI 0x09
57
#define PPPOE_CODE_PADO 0x07
58
#define PPPOE_CODE_PADR 0x19
59
#define PPPOE_CODE_PADS 0x65
60
#define PPPOE_CODE_PADT 0xa7
61
62
/* see RFC 2516 Appendix A */
63
#define PPPOE_TAG_END_OF_LIST 0x0000
/* End-Of-List */
64
#define PPPOE_TAG_SERVICE_NAME 0x0101
/* Service-Name */
65
#define PPPOE_TAG_AC_NAME 0x0102
/* AC-Name */
66
#define PPPOE_TAG_HOST_UNIQ 0x0103
/* Host-Uniq */
67
#define PPPOE_TAG_AC_COOKIE 0x0104
/* AC-Cookie */
68
#define PPPOE_TAG_VENDOR_SPECIFIC 0x0105
/* Vendor-Specific */
69
#define PPPOE_TAG_RELAY_SESSION_ID 0x0110
/* Relay-Session-Id */
70
#define PPPOE_TAG_SERVICE_NAME_ERROR 0x0201
/* Service-Name-Error */
71
#define PPPOE_TAG_AC_SYS_ERROR 0x0202
/* AC-System Error */
72
#define PPPOE_TAG_GEN_ERROR 0x0203
/* Generic-Error */
73
74
void
DecodePPPOERegisterTests
(
void
);
75
76
#endif
/* SURICATA_DECODE_PPPOE_H */
PPPOEDiscoveryTag_
Definition:
decode-pppoe.h:43
PPPOESessionHdr_
Definition:
decode-pppoe.h:35
PPPOESessionHdr_::protocol
uint16_t protocol
Definition:
decode-pppoe.h:40
PPPOEDiscoveryTag_::pppoe_tag_length
uint16_t pppoe_tag_length
Definition:
decode-pppoe.h:45
PPPOESessionHdr_::session_id
uint16_t session_id
Definition:
decode-pppoe.h:38
PPPOEDiscoveryHdr_::discovery_id
uint16_t discovery_id
Definition:
decode-pppoe.h:51
PPPOEDiscoveryHdr_::pppoe_code
uint8_t pppoe_code
Definition:
decode-pppoe.h:50
__attribute__
struct PPPOEDiscoveryTag_ __attribute__((__packed__)) PPPOEDiscoveryTag
DNP3 link header.
Definition:
decode-vlan.c:102
PPPOEDiscoveryHdr_
Definition:
decode-pppoe.h:48
DecodePPPOERegisterTests
void DecodePPPOERegisterTests(void)
Registers PPPOE unit tests.
Definition:
decode-pppoe.c:530
PPPOEDiscoveryTag_::pppoe_tag_type
uint16_t pppoe_tag_type
Definition:
decode-pppoe.h:44
PPPOESessionHdr_::pppoe_code
uint8_t pppoe_code
Definition:
decode-pppoe.h:37
PPPOEDiscoveryHdr_::pppoe_version_type
uint8_t pppoe_version_type
Definition:
decode-pppoe.h:49
PPPOESessionHdr
struct PPPOESessionHdr_ PPPOESessionHdr
PPPOEDiscoveryHdr_::pppoe_length
uint16_t pppoe_length
Definition:
decode-pppoe.h:52
PPPOESessionHdr_::pppoe_length
uint16_t pppoe_length
Definition:
decode-pppoe.h:39
PPPOESessionHdr_::pppoe_version_type
uint8_t pppoe_version_type
Definition:
decode-pppoe.h:36
src
decode-pppoe.h
Generated on Mon Oct 6 2025 23:30:27 for suricata by
1.8.18