27 lines
1.1 KiB
C
27 lines
1.1 KiB
C
#pragma once
|
|
// ethernet.h - tiny pre-lwIP Ethernet/ARP/ICMP shim.
|
|
//
|
|
// This is deliberately small: it gives NIC drivers something useful to feed
|
|
// while lwIP is not wired up yet. Keep the public surface generic so the lwIP
|
|
// netif glue can reuse NetSendFrame() and bypass this file later.
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <ke_status.h>
|
|
#include <net_device.h>
|
|
|
|
#define NET_IPV4_ADDR(a, b, c, d) \
|
|
((((uint32_t)(a) & 0xFFu) << 24) | \
|
|
(((uint32_t)(b) & 0xFFu) << 16) | \
|
|
(((uint32_t)(c) & 0xFFu) << 8) | \
|
|
((uint32_t)(d) & 0xFFu))
|
|
|
|
__declspec(dllexport) KSTATUS NetConfigureIpv4Static(uint32_t deviceIndex,
|
|
uint32_t address,
|
|
uint32_t netmask,
|
|
uint32_t gateway);
|
|
__declspec(dllexport) KSTATUS NetPingIpv4(uint32_t deviceIndex, uint32_t targetIp);
|
|
|
|
void NetEthernetAttachDevice(NET_DEVICE* device);
|
|
void NetEthernetReceive(NET_DEVICE* device, const void* frame, size_t length);
|