Changeset View
Changeset View
Standalone View
Standalone View
sys/netgraph/ng_pppoe.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
/******************************************************************** | /******************************************************************** | ||||
* Netgraph hook constants etc. | * Netgraph hook constants etc. | ||||
********************************************************************/ | ********************************************************************/ | ||||
/* Node type name. This should be unique among all netgraph node types */ | /* Node type name. This should be unique among all netgraph node types */ | ||||
#define NG_PPPOE_NODE_TYPE "pppoe" | #define NG_PPPOE_NODE_TYPE "pppoe" | ||||
#define NGM_PPPOE_COOKIE 1089893072 | #define NGM_PPPOE_COOKIE 1089893072 | ||||
#define NGM_PPPOE_SETMAXP_COOKIE 1441624322 | #define NGM_PPPOE_SETMAXP_COOKIE 1441624322 | ||||
#define NGM_PPPOE_PADM_COOKIE 1488405822 | |||||
#define PPPOE_SERVICE_NAME_SIZE 64 /* for now */ | #define PPPOE_SERVICE_NAME_SIZE 64 /* for now */ | ||||
#define PPPOE_PADM_VALUE_SIZE 128 /* for now */ | |||||
/* Hook names */ | /* Hook names */ | ||||
#define NG_PPPOE_HOOK_ETHERNET "ethernet" | #define NG_PPPOE_HOOK_ETHERNET "ethernet" | ||||
#define NG_PPPOE_HOOK_DEBUG "debug" | #define NG_PPPOE_HOOK_DEBUG "debug" | ||||
/* Mode names */ | /* Mode names */ | ||||
#define NG_PPPOE_STANDARD "standard" | #define NG_PPPOE_STANDARD "standard" | ||||
#define NG_PPPOE_3COM "3Com" | #define NG_PPPOE_3COM "3Com" | ||||
Show All 14 Lines | enum cmd { | ||||
NGM_PPPOE_CLOSE = 7, /* Session closed down */ | NGM_PPPOE_CLOSE = 7, /* Session closed down */ | ||||
NGM_PPPOE_SERVICE = 8, /* additional Service to advertise (in PADO) */ | NGM_PPPOE_SERVICE = 8, /* additional Service to advertise (in PADO) */ | ||||
NGM_PPPOE_ACNAME = 9, /* AC_NAME for informational purposes */ | NGM_PPPOE_ACNAME = 9, /* AC_NAME for informational purposes */ | ||||
NGM_PPPOE_GET_STATUS = 10, /* data in/out */ | NGM_PPPOE_GET_STATUS = 10, /* data in/out */ | ||||
NGM_PPPOE_SESSIONID = 11, /* Session_ID for informational purposes */ | NGM_PPPOE_SESSIONID = 11, /* Session_ID for informational purposes */ | ||||
NGM_PPPOE_SETMODE = 12, /* set to standard or compat modes */ | NGM_PPPOE_SETMODE = 12, /* set to standard or compat modes */ | ||||
NGM_PPPOE_GETMODE = 13, /* see current mode */ | NGM_PPPOE_GETMODE = 13, /* see current mode */ | ||||
NGM_PPPOE_SETENADDR = 14, /* set Ethernet address */ | NGM_PPPOE_SETENADDR = 14, /* set Ethernet address */ | ||||
NGM_PPPOE_SETMAXP = 15 /* Set PPP-Max-Payload value */ | NGM_PPPOE_SETMAXP = 15, /* Set PPP-Max-Payload value */ | ||||
NGM_PPPOE_SEND_HURL = 16, /* Send PADM HURL message */ | |||||
NGM_PPPOE_HURL = 17, /* HURL for informational purposes */ | |||||
NGM_PPPOE_SEND_MOTM = 18, /* Send PADM MOTM message */ | |||||
NGM_PPPOE_MOTM = 19 /* MOTM for informational purposes */ | |||||
}; | }; | ||||
/*********************** | /*********************** | ||||
* Structures passed in the various netgraph command messages. | * Structures passed in the various netgraph command messages. | ||||
***********************/ | ***********************/ | ||||
/* This structure is returned by the NGM_PPPOE_GET_STATUS command */ | /* This structure is returned by the NGM_PPPOE_GET_STATUS command */ | ||||
struct ngpppoestat { | struct ngpppoestat { | ||||
u_int packets_in; /* packets in from ethernet */ | u_int packets_in; /* packets in from ethernet */ | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* This structure is used to send PPP-Max-Payload value from server to client. | * This structure is used to send PPP-Max-Payload value from server to client. | ||||
*/ | */ | ||||
struct ngpppoe_maxp { | struct ngpppoe_maxp { | ||||
char hook[NG_HOOKSIZ]; /* hook associated with event session */ | char hook[NG_HOOKSIZ]; /* hook associated with event session */ | ||||
uint16_t data; | uint16_t data; | ||||
}; | }; | ||||
/* | |||||
* This structure is used to send PADM messages from server to client. | |||||
*/ | |||||
struct ngpppoe_padm { | |||||
char msg[PPPOE_PADM_VALUE_SIZE]; | |||||
}; | |||||
/******************************************************************** | /******************************************************************** | ||||
* Constants and definitions specific to pppoe | * Constants and definitions specific to pppoe | ||||
********************************************************************/ | ********************************************************************/ | ||||
#define PPPOE_TIMEOUT_LIMIT 64 | #define PPPOE_TIMEOUT_LIMIT 64 | ||||
#define PPPOE_OFFER_TIMEOUT 16 | #define PPPOE_OFFER_TIMEOUT 16 | ||||
#define PPPOE_INITIAL_TIMEOUT 2 | #define PPPOE_INITIAL_TIMEOUT 2 | ||||
/* Codes to identify message types */ | /* Codes to identify message types */ | ||||
#define PADI_CODE 0x09 | #define PADI_CODE 0x09 | ||||
#define PADO_CODE 0x07 | #define PADO_CODE 0x07 | ||||
#define PADR_CODE 0x19 | #define PADR_CODE 0x19 | ||||
#define PADS_CODE 0x65 | #define PADS_CODE 0x65 | ||||
#define PADT_CODE 0xa7 | #define PADT_CODE 0xa7 | ||||
#define PADM_CODE 0xd3 | |||||
/* Tag identifiers */ | /* Tag identifiers */ | ||||
#if BYTE_ORDER == BIG_ENDIAN | #if BYTE_ORDER == BIG_ENDIAN | ||||
#define PTT_EOL (0x0000) | #define PTT_EOL (0x0000) | ||||
#define PTT_SRV_NAME (0x0101) | #define PTT_SRV_NAME (0x0101) | ||||
#define PTT_AC_NAME (0x0102) | #define PTT_AC_NAME (0x0102) | ||||
#define PTT_HOST_UNIQ (0x0103) | #define PTT_HOST_UNIQ (0x0103) | ||||
#define PTT_AC_COOKIE (0x0104) | #define PTT_AC_COOKIE (0x0104) | ||||
#define PTT_VENDOR (0x0105) | #define PTT_VENDOR (0x0105) | ||||
#define PTT_RELAY_SID (0x0110) | #define PTT_RELAY_SID (0x0110) | ||||
#define PTT_HURL (0x0111) /* PPPoE Extensions (CARREL) */ | |||||
#define PTT_MOTM (0x0112) /* PPPoE Extensions (CARREL) */ | |||||
#define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ | #define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ | ||||
#define PTT_SRV_ERR (0x0201) | #define PTT_SRV_ERR (0x0201) | ||||
#define PTT_SYS_ERR (0x0202) | #define PTT_SYS_ERR (0x0202) | ||||
#define PTT_GEN_ERR (0x0203) | #define PTT_GEN_ERR (0x0203) | ||||
#define ETHERTYPE_PPPOE_DISC 0x8863 /* pppoe discovery packets */ | #define ETHERTYPE_PPPOE_DISC 0x8863 /* pppoe discovery packets */ | ||||
#define ETHERTYPE_PPPOE_SESS 0x8864 /* pppoe session packets */ | #define ETHERTYPE_PPPOE_SESS 0x8864 /* pppoe session packets */ | ||||
#define ETHERTYPE_PPPOE_3COM_DISC 0x3c12 /* pppoe discovery packets 3com? */ | #define ETHERTYPE_PPPOE_3COM_DISC 0x3c12 /* pppoe discovery packets 3com? */ | ||||
#define ETHERTYPE_PPPOE_3COM_SESS 0x3c13 /* pppoe session packets 3com? */ | #define ETHERTYPE_PPPOE_3COM_SESS 0x3c13 /* pppoe session packets 3com? */ | ||||
#else | #else | ||||
#define PTT_EOL (0x0000) | #define PTT_EOL (0x0000) | ||||
#define PTT_SRV_NAME (0x0101) | #define PTT_SRV_NAME (0x0101) | ||||
#define PTT_AC_NAME (0x0201) | #define PTT_AC_NAME (0x0201) | ||||
#define PTT_HOST_UNIQ (0x0301) | #define PTT_HOST_UNIQ (0x0301) | ||||
#define PTT_AC_COOKIE (0x0401) | #define PTT_AC_COOKIE (0x0401) | ||||
#define PTT_VENDOR (0x0501) | #define PTT_VENDOR (0x0501) | ||||
#define PTT_RELAY_SID (0x1001) | #define PTT_RELAY_SID (0x1001) | ||||
#define PTT_HURL (0x1101) /* PPPoE Extensions (CARREL) */ | |||||
#define PTT_MOTM (0x1201) /* PPPoE Extensions (CARREL) */ | |||||
#define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ | #define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ | ||||
#define PTT_SRV_ERR (0x0102) | #define PTT_SRV_ERR (0x0102) | ||||
#define PTT_SYS_ERR (0x0202) | #define PTT_SYS_ERR (0x0202) | ||||
#define PTT_GEN_ERR (0x0302) | #define PTT_GEN_ERR (0x0302) | ||||
#define ETHERTYPE_PPPOE_DISC 0x6388 /* pppoe discovery packets */ | #define ETHERTYPE_PPPOE_DISC 0x6388 /* pppoe discovery packets */ | ||||
#define ETHERTYPE_PPPOE_SESS 0x6488 /* pppoe session packets */ | #define ETHERTYPE_PPPOE_SESS 0x6488 /* pppoe session packets */ | ||||
#define ETHERTYPE_PPPOE_3COM_DISC 0x123c /* pppoe discovery packets 3com? */ | #define ETHERTYPE_PPPOE_3COM_DISC 0x123c /* pppoe discovery packets 3com? */ | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |