pppoe.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <stdint.h>`
`#include <unistd.h>`
`#include <sys/types.h>`
`#include <sys/ioctl.h>`
`#include <sys/socket.h>`
`#include <sys/time.h>`
`#include <fcntl.h>`
`#include <errno.h>`
`#include <string.h>`
`#include <linux/if.h>`
`#include <net/ethernet.h>`
`#include <net/if_arp.h>`
`#include <netinet/in.h>`
`#include <netpacket/packet.h>`
`#include "hd.h"`
`#include "hd_int.h"`
`#include "pppoe.h"`

## 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)

## Variables

static hd_data_t * | hd_data

## Variable Documentation

## hd_data

hd_data_t* hd_data

static

Referenced by _read_klog(), add_cdrom_info(), add_disk_size(), add_edid_from_file(), add_edid_info(), add_hd_entry(), add_ide_sysfs_info(), add_input_dev(), add_joystick_details(), add_kma(), add_lcd_info(), add_monitor(), add_mv643xx_eth(), add_other_sysfs_info(), add_partitions(), add_pci(), add_pci_data(), add_pci_entry(), add_scsi_sysfs_info(), add_serial_console(), add_serial_modem(), add_serial_mouse(), add_uml(), add_xen_network(), add_xen_storage(), add_xpnet(), assign_hw_class(), at_cmd(), chk_edid_info(), copy_log2shm(), create_model_name(), detect_smp_bios(), detect_smp_prom(), dev_name_duplicate(), device_class(), do_alva(), do_baum(), do_fhp(), do_fhp_new(), do_ht(), do_lp(), do_zip(), dsl_driver(), dump_bios(), dump_cpu(), dump_cpu_data(), dump_floppy_data(), dump_hid(), dump_hid2(), dump_klog(), dump_misc_data(), dump_misc_proc_data(), dump_normal(), dump_parallel_data(), dump_pci_data(), dump_prom(), dump_ser_modem_data(), dump_ser_mouse_data(), dump_serial_data(), dump_sys(), exists_hd_entry(), expand_driver_info(), fb_get_info(), find_udi(), fix_edid_info(), fix_probe_features(), free_devtree(), free_old_hd_entries(), get_block_devs(), get_cmd_param(), get_cmdline(), get_driverinfo(), get_ethtool_priv(), get_generic_scsi_devs(), get_input_devices(), get_input_devs(), get_kernel_version(), get_linkstate(), get_phwaddr(), get_printer_devs(), get_probe_env(), get_probe_val_int(), get_probe_val_list(), get_probe_val_str(), get_scsi_tape(), get_serial_devs(), get_serial_info(), get_serial_modem(), get_serial_mouse(), get_usb_devs(), get_vbe_info(), guess_modem_name(), hal_find_device(), has_something_attached(), hd2prop(), hd_add_driver_data(), hd_add_id(), hd_apm_enabled(), hd_base_class_list(), hd_boot_arch(), hd_boot_disk(), hd_bus_list(), hd_change_config_status(), hd_change_status(), hd_clear_probe_feature(), hd_color(), hd_cpu_arch(), hd_display_adapter(), hd_dump_entry(), hd_find_sysfs_id(), hd_find_sysfs_id_devname(), hd_fork(), hd_fork_done(), hd_free_hd_data(), hd_get_device_by_id(), hd_get_device_by_idx(), hd_getdisksize(), hd_has_pcmcia(), hd_is_sgi_altix(), hd_is_shm_ptr(), hd_is_uml(), hd_is_xen(), hd_list(), hd_list2(), hd_list_with_status(), hd_list_with_status2(), hd_log(), hd_log_hex(), hd_log_printf(), hd_log_printf(), hd_mac_color(), hd_manual_read_entry(), hd_manual_write_entry(), hd_modinfo_db(), hd_module_is_active(), hd_module_list(), hd_move_to_shm(), hd_pci_read_data(), hd_probe_feature(), hd_read_cdrom_info(), hd_read_config(), hd_read_ibmebus(), hd_read_macio(), hd_read_mdio(), hd_read_mmap(), hd_read_mmc(), hd_read_nd(), hd_read_of_platform(), hd_read_platform(), hd_read_ps3_system_bus(), hd_read_sdio(), hd_read_uisvirtpci(), hd_read_vio(), hd_read_virtio(), hd_read_visorbus(), hd_read_vm(), hd_read_xen(), hd_report_this(), hd_scan(), hd_scan_bios(), hd_scan_braille(), hd_scan_cpu(), hd_scan_dsl(), hd_scan_fb(), hd_scan_floppy(), hd_scan_hal(), hd_scan_hal_assign_udi(), hd_scan_hal_basic(), hd_scan_input(), hd_scan_int(), hd_scan_isa(), hd_scan_isapnp(), hd_scan_isdn(), hd_scan_kbd(), hd_scan_manual(), hd_scan_manual2(), hd_scan_memory(), hd_scan_misc(), hd_scan_misc2(), hd_scan_modem(), hd_scan_monitor(), hd_scan_mouse(), hd_scan_net(), hd_scan_no_hal(), hd_scan_parallel(), hd_scan_pcmcia(), hd_scan_pppoe(), hd_scan_prom(), hd_scan_s390(), hd_scan_s390disks(), hd_scan_sbus(), hd_scan_serial(), hd_scan_sys(), hd_scan_sysfs_block(), hd_scan_sysfs_pci(), hd_scan_sysfs_scsi(), hd_scan_sysfs_usb(), hd_scan_with_hal(), hd_scan_wlan(), hd_scan_xtra(), hd_set_probe_feature(), hd_set_probe_feature_hw(), hd_shm_add(), hd_shm_add_str(), hd_shm_add_str_list(), hd_shm_clean(), hd_shm_done(), hd_shm_init(), hd_smp_support(), hd_sub_class_list(), hd_sysfs_driver_list(), hd_sysfs_find_driver(), hd_usb_support(), hd_write_config(), hddb_add_info(), hddb_get_packages(), hddb_init(), hddb_init_external(), hddb_init_pci(), hddb_search(), hddb_to_device_driver(), int_add_driver_modules(), int_cdrom(), int_devicenames(), int_find_parent(), int_fix_usb_scsi(), int_floppy(), int_hotplug(), int_media_check(), int_modem(), int_mouse(), int_udev(), int_update_driver_data(), int_wlan(), is_audio(), is_kms_active(), is_modem(), is_pcmcia_ctrl(), is_pppoe(), isdn_driver(), kbd_driver(), kcore_mem(), klog_mem(), klog_mem2(), link_hal_tree(), load_module(), load_module_with_params(), match_modinfo(), meminfo_mem(), meminfo_xen(), monitor_driver(), new_id(), pcmcia_ctrl_read_data(), pcmcia_read_data(), pnpdump(), probe_module(), progress(), prop2hd(), read_block0(), read_cdroms(), read_cpuinfo(), read_hal(), read_klog(), read_kmods(), read_modem(), read_partitions(), read_properties(), read_udevinfo(), read_usb_lp(), remove_hd_entries(), remove_tagged_hd_entries(), reverse_str_list(), run_cmd(), set_class_entries(), set_probe_feature(), set_probe_val(), sigusr1_handler(), smbios_dump(), smbios_parse(), sub_device_class(), unload_module(), update_irq_usage(), and write_modem().