XenevaOS
Loading...
Searching...
No Matches
arp.h
Go to the documentation of this file.
1
30#ifndef __ARP_H__
31#define __ARP_H__
32
33#include <stdint.h>
34#include <fs/vfs.h>
35
36#define ARP_OPERATION_REQUEST 0x0100
37#define ARP_OPERATION_RESPONSE 0x0200
38
39#pragma pack(push,1)
55#pragma pack(pop)
56
63
64
65/*
66 * ARPProtocolInitialise -- initialise arp protocol
67 */
68extern void ARPProtocolInitialise();
69
70/*
71 * ARPProtocolAdd -- add a new information to ARP cache list
72 * @param nic -- Pointer to NIC device
73 * @param address -- IP Address
74 * @param hwaddr -- Hardware address to add
75 */
76extern void ARPProtocolAdd(AuVFSNode* nic, uint32_t address, uint8_t* hwaddr);
77
78/*
79 * AuARPGet -- Returns an ARP by its ip address
80 * @param address -- IP Address to look
81 */
82extern AuARPCache* AuARPGet(uint32_t address);
83
84/*
85 * AuARPRequestMAC -- request a mac address from
86 * server
87 */
88extern void AuARPRequestMAC(AuVFSNode* nic, uint32_t addr);
89
90/*
91 * ARPHandlePacket -- handle incoming ARP packet
92 * @param data -- Pointer to ARP packet
93 * @param nic -- Pointer to Network Device file
94 */
95extern void ARPHandlePacket(void* data, AuVFSNode* nic);
96
97#endif
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
unsigned short int uint16_t
Definition acefiex.h:162
void ARPHandlePacket(void *data, AuVFSNode *nic)
Definition arp.cpp:112
void ARPProtocolInitialise()
Definition arp.cpp:45
void ARPProtocolAdd(AuVFSNode *nic, uint32_t address, uint8_t *hwaddr)
Definition arp.cpp:55
void AuARPRequestMAC(AuVFSNode *nic, uint32_t addr)
Definition arp.cpp:82
AuARPCache * AuARPGet(uint32_t address)
Definition arp.cpp:68
struct _arp_ NetARP
struct _arp_cache_ AuARPCache
AuVFSNode * nic
Definition e1000.cpp:67
Definition vfs.h:89
Definition arp.h:40
uint16_t hwAddressType
Definition arp.h:41
uint8_t hwAddressSize
Definition arp.h:43
uint16_t hwProtocolType
Definition arp.h:42
union _arp_::@16 arp_data
uint32_t arp_tpa
Definition arp.h:51
uint8_t arp_sha[6]
Definition arp.h:48
uint8_t protocolSize
Definition arp.h:44
uint32_t arp_spa
Definition arp.h:49
uint16_t operation
Definition arp.h:45
uint8_t arp_tha[6]
Definition arp.h:50
struct _arp_::@16::@17 arp_eth_ipv4
Definition arp.h:57
uint16_t flags
Definition arp.h:59
AuVFSNode * nic
Definition arp.h:61
uint8_t hw_address[6]
Definition arp.h:58
uint32_t ipAddress
Definition arp.h:60