|
libhd 5.0
|
PPPoE devices scan functions. More...
Data Structures | |
| struct | PPPoEPacketStruct |
| struct | PPPoETagStruct |
| struct | PPPoEConnectionStruct |
| struct | PacketCriteriaStruct |
Macros | |
| #define | ETH_PPPOE_DISCOVERY 0x8863 |
| #define | ETH_PPPOE_SESSION 0x8864 |
| #define | CODE_PADI 0x09 |
| #define | CODE_PADO 0x07 |
| #define | CODE_PADR 0x19 |
| #define | CODE_PADS 0x65 |
| #define | CODE_PADT 0xA7 |
| #define | TAG_END_OF_LIST 0x0000 |
| #define | TAG_SERVICE_NAME 0x0101 |
| #define | TAG_AC_NAME 0x0102 |
| #define | TAG_HOST_UNIQ 0x0103 |
| #define | TAG_AC_COOKIE 0x0104 |
| #define | TAG_VENDOR_SPECIFIC 0x0105 |
| #define | TAG_RELAY_SESSION_ID 0x0110 |
| #define | TAG_SERVICE_NAME_ERROR 0x0201 |
| #define | TAG_AC_SYSTEM_ERROR 0x0202 |
| #define | TAG_GENERIC_ERROR 0x0203 |
| #define | MAX_ATTEMPTS 2 |
| #define | PADO_TIMEOUT 3 |
| #define | PPPOE_OVERHEAD 6 /* type, code, session, length */ |
| #define | HDR_SIZE (sizeof (struct ethhdr) + PPPOE_OVERHEAD) |
| #define | MAX_PPPOE_PAYLOAD (ETH_DATA_LEN - PPPOE_OVERHEAD) |
| #define | TAG_HDR_SIZE 4 |
| #define | NOT_UNICAST(e) |
Typedefs | |
| typedef struct PPPoEPacketStruct | PPPoEPacket |
| typedef struct PPPoETagStruct | PPPoETag |
| typedef void | parse_func(uint16_t type, uint16_t len, unsigned char *data, void *extra) |
| typedef struct PPPoEConnectionStruct | PPPoEConnection |
| typedef struct PacketCriteriaStruct | PacketCriteria |
Functions | |
| 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.
| #define CODE_PADI 0x09 |
Referenced by send_padi().
| #define CODE_PADO 0x07 |
Referenced by wait_for_pado().
| #define CODE_PADR 0x19 |
| #define CODE_PADS 0x65 |
| #define CODE_PADT 0xA7 |
| #define ETH_PPPOE_DISCOVERY 0x8863 |
Referenced by open_interfaces(), and send_padi().
| #define ETH_PPPOE_SESSION 0x8864 |
| #define HDR_SIZE (sizeof (struct ethhdr) + PPPOE_OVERHEAD) |
Referenced by send_padi(), and wait_for_pado().
| #define MAX_ATTEMPTS 2 |
Referenced by discovery().
| #define MAX_PPPOE_PAYLOAD (ETH_DATA_LEN - PPPOE_OVERHEAD) |
Referenced by check_room().
| #define NOT_UNICAST | ( | e | ) |
Referenced by open_interfaces(), and wait_for_pado().
| #define PADO_TIMEOUT 3 |
Referenced by wait_for_pado().
| #define PPPOE_OVERHEAD 6 /* type, code, session, length */ |
| #define TAG_AC_COOKIE 0x0104 |
| #define TAG_AC_NAME 0x0102 |
Referenced by parse_pado_tags().
| #define TAG_AC_SYSTEM_ERROR 0x0202 |
Referenced by parse_pado_tags().
| #define TAG_END_OF_LIST 0x0000 |
Referenced by parse_packet().
| #define TAG_GENERIC_ERROR 0x0203 |
Referenced by parse_pado_tags().
| #define TAG_HDR_SIZE 4 |
Referenced by parse_packet(), and send_padi().
| #define TAG_HOST_UNIQ 0x0103 |
Referenced by parse_hostuniq(), and send_padi().
| #define TAG_RELAY_SESSION_ID 0x0110 |
| #define TAG_SERVICE_NAME 0x0101 |
Referenced by parse_pado_tags(), and send_padi().
| #define TAG_SERVICE_NAME_ERROR 0x0201 |
Referenced by parse_pado_tags().
| #define TAG_VENDOR_SPECIFIC 0x0105 |
| typedef struct PacketCriteriaStruct PacketCriteria |
| typedef void parse_func(uint16_t type, uint16_t len, unsigned char *data, void *extra) |
| typedef struct PPPoEConnectionStruct PPPoEConnection |
| typedef struct PPPoEPacketStruct PPPoEPacket |
| typedef struct PPPoETagStruct PPPoETag |
|
static |
References ADD2LOG, PPPoEConnectionStruct::ifname, and MAX_PPPOE_PAYLOAD.
Referenced by send_padi().
|
static |
References PPPoEConnectionStruct::fd.
Referenced by discovery().
|
static |
References ADD2LOG, close_intefaces(), MAX_ATTEMPTS, open_interfaces(), send_padi(), and wait_for_pado().
Referenced by hd_scan_pppoe().
| void hd_scan_pppoe | ( | hd_data_t * | hd_data2 | ) |
References ADD2LOG, s_hd_t::base_class, bc_network_interface, discovery(), PPPoEConnectionStruct::fd, PPPoEConnectionStruct::hd, hd_data, hd_probe_feature(), hd_id_t::id, PPPoEConnectionStruct::ifname, s_hd_t::is, mod_pppoe, new_mem(), s_hd_t::next, s_hd_t::is_s::pppoe, pr_pppoe, PROGRESS, sc_nif_ethernet, s_hd_t::sub_class, and s_hd_t::unix_dev_name.
Referenced by hd_scan_no_hal().
|
static |
References ADD2LOG, ETH_PPPOE_DISCOVERY, PPPoEConnectionStruct::fd, PPPoEConnectionStruct::ifname, PPPoEConnectionStruct::my_mac, and NOT_UNICAST.
Referenced by discovery().
|
static |
References PPPoEPacketStruct::ethHdr, PPPoEConnectionStruct::my_mac, parse_hostuniq(), and parse_packet().
Referenced by wait_for_pado().
|
static |
References TAG_HOST_UNIQ.
Referenced by packet_for_me().
|
static |
References ADD2LOG, PPPoEConnectionStruct::ifname, PPPoEPacketStruct::length, PPPoEPacketStruct::payload, TAG_END_OF_LIST, TAG_HDR_SIZE, PPPoEPacketStruct::type, and PPPoEPacketStruct::ver.
Referenced by packet_for_me(), and wait_for_pado().
|
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().
|
static |
References ADD2LOG.
Referenced by wait_for_pado().
|
static |
References ADD2LOG.
Referenced by send_padi().
|
static |
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().
|
static |
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().