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
40#pragma pack(push,1)
56#pragma pack(pop)
57
64
65
66/*
67 * ARPProtocolInitialise -- initialise arp protocol
68 */
69extern void ARPProtocolInitialise();
70
71/*
72 * ARPProtocolAdd -- add a new information to ARP cache list
73 * @param nic -- Pointer to NIC device
74 * @param address -- IP Address
75 * @param hwaddr -- Hardware address to add
76 */
77extern void ARPProtocolAdd(AuVFSNode* nic, uint32_t address, uint8_t* hwaddr);
78
79/*
80 * AuARPGet -- Returns an ARP by its ip address
81 * @param address -- IP Address to look
82 */
83extern AuARPCache* AuARPGet(uint32_t address);
84
85/*
86 * AuARPRequestMAC -- request a mac address from
87 * server
88 */
89extern void AuARPRequestMAC(AuVFSNode* nic, uint32_t addr);
90
91/*
92 * ARPHandlePacket -- handle incoming ARP packet
93 * @param data -- Pointer to ARP packet
94 * @param nic -- Pointer to Network Device file
95 */
96extern void ARPHandlePacket(void* data, AuVFSNode* nic);
97
98#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()
ARPProtocolInitialise – initialise arp protocol.
Definition arp.cpp:45
void ARPProtocolAdd(AuVFSNode *nic, uint32_t address, uint8_t *hwaddr)
ARPProtocolAdd – add a new information to ARP cache list.
Definition arp.cpp:55
void AuARPRequestMAC(AuVFSNode *nic, uint32_t addr)
AuARPRequestMAC – request a mac address from server.
Definition arp.cpp:82
AuARPCache * AuARPGet(uint32_t address)
AuARPGet – Returns an ARP by its ip address.
Definition arp.cpp:68
struct _arp_ NetARP
struct _arp_cache_ AuARPCache
AuVFSNode * nic
Definition e1000.cpp:67
Definition vfs.h:95
Definition arp.h:41
uint16_t hwAddressType
Definition arp.h:42
uint8_t hwAddressSize
Definition arp.h:44
uint16_t hwProtocolType
Definition arp.h:43
union _arp_::@16 arp_data
uint32_t arp_tpa
Definition arp.h:52
uint8_t arp_sha[6]
Definition arp.h:49
uint8_t protocolSize
Definition arp.h:45
uint32_t arp_spa
Definition arp.h:50
uint16_t operation
Definition arp.h:46
uint8_t arp_tha[6]
Definition arp.h:51
struct _arp_::@16::@17 arp_eth_ipv4
Definition arp.h:58
uint16_t flags
Definition arp.h:60
AuVFSNode * nic
Definition arp.h:62
uint8_t hw_address[6]
Definition arp.h:59
uint32_t ipAddress
Definition arp.h:61