diff options
Diffstat (limited to 'kernel/inc/net.h')
-rw-r--r-- | kernel/inc/net.h | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/kernel/inc/net.h b/kernel/inc/net.h index b5193ed..211cf90 100644 --- a/kernel/inc/net.h +++ b/kernel/inc/net.h @@ -5,29 +5,6 @@ #include <def.h> -#define RX_BUF_SIZE 0x3000 - -#define RTL8139_VENDOR_ID 0x10ec -#define RTL8139_DEVICE_ID 0x8139 - -#define RTL_ROK (1 << 0) -#define RTL_TOK (1 << 2) - -#define RTL_PORT_MAC 0x00 -#define RTL_PORT_MAR 0x08 -#define RTL_PORT_TXSTAT 0x10 -#define RTL_PORT_TXBUF 0x20 -#define RTL_PORT_RBSTART 0x30 -#define RTL_PORT_CMD 0x37 -#define RTL_PORT_RXPTR 0x38 -#define RTL_PORT_RXADDR 0x3A -#define RTL_PORT_IMR 0x3C -#define RTL_PORT_ISR 0x3E -#define RTL_PORT_TCR 0x40 -#define RTL_PORT_RCR 0x44 -#define RTL_PORT_RXMISS 0x4C -#define RTL_PORT_CONFIG 0x52 - #define ETHERNET_TYPE_IP4 0x0800 #define ETHERNET_TYPE_IP6 0x86dd #define ETHERNET_TYPE_ARP 0x0806 @@ -39,6 +16,21 @@ struct ethernet_packet { u8 data[]; } __attribute__((packed)); +struct ip_packet { + u8 version_ihl; + u8 dscp_ecn; + u16 length; + u16 id; + u8 flags_fragment; + u8 ttl; + u8 protocol; + u16 checksum; + u8 src_ip[4]; + u8 dst_ip[4]; + u8 data[]; +} __attribute__((packed)); + +void ethernet_handle_packet(struct ethernet_packet *packet, int len); void net_install(); #endif |