BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / network / ppp / pppoe / PPPoE.h
blob6bb9350532332cb5e1cbeaa379db0fd57b8807b6
1 /*
2 * Copyright 2003-2004, Waldemar Kornewald <wkornew@gmx.net>
3 * Distributed under the terms of the MIT License.
4 */
6 #ifndef PPPoE__H
7 #define PPPoE__H
9 #include <SupportDefs.h>
10 #include <net/if.h>
11 #include <netinet/if_ether.h>
13 class PPPoEDevice;
16 #define PPPoE_QUERY_REPORT_SIZE 2048
17 #define PPPoE_QUERY_REPORT 'PoEQ'
18 // the code value used for query reports
20 #define PPPoE_HEADER_SIZE 6
21 // without ethernet header
22 #define PPPoE_TIMEOUT 3000000
23 // 3 seconds
24 #define PPPoE_MAX_ATTEMPTS 2
25 // maximum number of PPPoE's connect-retries
27 #define PPPoE_VERSION 0x1
28 #define PPPoE_TYPE 0x1
30 #define PPPoE_INTERFACE_KEY "Interface"
31 #define PPPoE_AC_NAME_KEY "ACName"
32 #define PPPoE_SERVICE_NAME_KEY "ServiceName"
34 enum pppoe_ops {
35 PPPoE_GET_INTERFACES,
36 PPPoE_QUERY_SERVICES
39 typedef struct pppoe_query_request {
40 const char *interfaceName;
41 thread_id receiver;
42 } pppoe_query_request;
44 extern struct core_module_info *core;
47 typedef struct pppoe_header {
48 uint8 version : 4;
49 uint8 type : 4;
50 uint8 code;
51 uint16 sessionID;
52 uint16 length;
53 uint8 data[0];
54 } _PACKED pppoe_header;
56 typedef struct complete_pppoe_header {
57 struct ether_header ethernetHeader;
58 pppoe_header pppoeHeader;
59 } complete_pppoe_header;
62 // defined in pppoe.cpp
63 extern ifnet *FindPPPoEInterface(const char *name);
64 extern uint32 NewHostUniq();
65 extern void add_device(PPPoEDevice *device);
66 extern void remove_device(PPPoEDevice *device);
68 #if DEBUG
69 // defined in PPPoEDevice.cpp
70 extern void dump_packet(struct mbuf *packet);
71 #endif // DEBUG
74 #endif