PPPoE devices scan functions.
More...
|
static int | check_room (PPPoEConnection *conn, unsigned char *cursor, unsigned char *start, uint16_t len) |
|
static int | parse_packet (PPPoEConnection *conn, PPPoEPacket *packet, parse_func *func, void *extra) |
|
static int | open_interfaces (int n, PPPoEConnection *conns) |
|
static void | close_intefaces (int n, PPPoEConnection *conns) |
|
static int | send_packet (int fd, PPPoEPacket *pkt, size_t size) |
|
static int | receive_packet (int fd, PPPoEPacket *pkt, size_t *size) |
|
static void | parse_hostuniq (uint16_t type, uint16_t len, unsigned char *data, void *extra) |
|
static int | packet_for_me (PPPoEConnection *conn, PPPoEPacket *packet) |
|
static void | parse_pado_tags (uint16_t type, uint16_t len, unsigned char *data, void *extra) |
|
static int | send_padi (int n, PPPoEConnection *conns) |
|
static int | wait_for_pado (int n, PPPoEConnection *conns) |
|
static void | discovery (int n, PPPoEConnection *conns) |
|
void | hd_scan_pppoe (hd_data_t *hd_data2) |
|
PPPoE devices scan functions.
◆ CODE_PADI
◆ CODE_PADO
◆ CODE_PADR
◆ CODE_PADS
◆ CODE_PADT
◆ ETH_PPPOE_DISCOVERY
#define ETH_PPPOE_DISCOVERY 0x8863 |
◆ ETH_PPPOE_SESSION
#define ETH_PPPOE_SESSION 0x8864 |
◆ HDR_SIZE
◆ MAX_ATTEMPTS
◆ MAX_PPPOE_PAYLOAD
◆ NOT_UNICAST
#define NOT_UNICAST |
( |
|
e | ) |
((e[0] & 0x01) != 0) |
◆ PADO_TIMEOUT
◆ PPPOE_OVERHEAD
#define PPPOE_OVERHEAD 6 /* type, code, session, length */ |
◆ TAG_AC_COOKIE
#define TAG_AC_COOKIE 0x0104 |
◆ TAG_AC_NAME
#define TAG_AC_NAME 0x0102 |
◆ TAG_AC_SYSTEM_ERROR
#define TAG_AC_SYSTEM_ERROR 0x0202 |
◆ TAG_END_OF_LIST
#define TAG_END_OF_LIST 0x0000 |
◆ TAG_GENERIC_ERROR
#define TAG_GENERIC_ERROR 0x0203 |
◆ TAG_HDR_SIZE
◆ TAG_HOST_UNIQ
#define TAG_HOST_UNIQ 0x0103 |
◆ TAG_RELAY_SESSION_ID
#define TAG_RELAY_SESSION_ID 0x0110 |
◆ TAG_SERVICE_NAME
#define TAG_SERVICE_NAME 0x0101 |
◆ TAG_SERVICE_NAME_ERROR
#define TAG_SERVICE_NAME_ERROR 0x0201 |
◆ TAG_VENDOR_SPECIFIC
#define TAG_VENDOR_SPECIFIC 0x0105 |
◆ PacketCriteria
◆ parse_func
typedef void parse_func(uint16_t type, uint16_t len, unsigned char *data, void *extra) |
◆ PPPoEConnection
◆ PPPoEPacket
◆ PPPoETag
◆ check_room()
static int check_room |
( |
PPPoEConnection * |
conn, |
|
|
unsigned char * |
cursor, |
|
|
unsigned char * |
start, |
|
|
uint16_t |
len |
|
) |
| |
|
static |
◆ close_intefaces()
◆ discovery()
◆ hd_scan_pppoe()
References ADD2LOG, s_hd_t::base_class, bc_network_interface, discovery(), hd_data_t::hd, hd_data, hd_probe_feature(), hd_id_t::id, mod_pppoe, hd_data_t::module, new_mem(), s_hd_t::next, pr_pppoe, PROGRESS, sc_nif_ethernet, s_hd_t::sub_class, and s_hd_t::unix_dev_name.
Referenced by hd_scan_no_hal().
◆ open_interfaces()
◆ packet_for_me()
◆ parse_hostuniq()
static void parse_hostuniq |
( |
uint16_t |
type, |
|
|
uint16_t |
len, |
|
|
unsigned char * |
data, |
|
|
void * |
extra |
|
) |
| |
|
static |
◆ parse_packet()
◆ parse_pado_tags()
static void parse_pado_tags |
( |
uint16_t |
type, |
|
|
uint16_t |
len, |
|
|
unsigned char * |
data, |
|
|
void * |
extra |
|
) |
| |
|
static |
References PacketCriteriaStruct::acname_ok, ADD2LOG, PacketCriteriaStruct::conn, PacketCriteriaStruct::error, PPPoEConnectionStruct::ifname, PacketCriteriaStruct::servicename_ok, TAG_AC_NAME, TAG_AC_SYSTEM_ERROR, TAG_GENERIC_ERROR, TAG_SERVICE_NAME, and TAG_SERVICE_NAME_ERROR.
Referenced by wait_for_pado().
◆ receive_packet()
static int receive_packet |
( |
int |
fd, |
|
|
PPPoEPacket * |
pkt, |
|
|
size_t * |
size |
|
) |
| |
|
static |
◆ send_packet()
static int send_packet |
( |
int |
fd, |
|
|
PPPoEPacket * |
pkt, |
|
|
size_t |
size |
|
) |
| |
|
static |
◆ send_padi()
References ADD2LOG, check_room(), PPPoEPacketStruct::code, CODE_PADI, ETH_PPPOE_DISCOVERY, PPPoEPacketStruct::ethHdr, PPPoEConnectionStruct::fd, HDR_SIZE, PPPoEConnectionStruct::ifname, PPPoEPacketStruct::length, PPPoETagStruct::length, PPPoEConnectionStruct::my_mac, PPPoEPacketStruct::payload, PPPoETagStruct::payload, PPPoEConnectionStruct::received_pado, send_packet(), PPPoEPacketStruct::session, TAG_HDR_SIZE, TAG_HOST_UNIQ, TAG_SERVICE_NAME, PPPoEPacketStruct::type, PPPoETagStruct::type, and PPPoEPacketStruct::ver.
Referenced by discovery().
◆ wait_for_pado()
References PacketCriteriaStruct::acname_ok, ADD2LOG, PPPoEPacketStruct::code, CODE_PADO, PacketCriteriaStruct::conn, PacketCriteriaStruct::error, PPPoEPacketStruct::ethHdr, PPPoEConnectionStruct::fd, HDR_SIZE, PPPoEConnectionStruct::ifname, PPPoEPacketStruct::length, NOT_UNICAST, packet_for_me(), PADO_TIMEOUT, parse_packet(), parse_pado_tags(), PPPoEConnectionStruct::peer_mac, receive_packet(), PPPoEConnectionStruct::received_pado, and PacketCriteriaStruct::servicename_ok.
Referenced by discovery().