NetBurner 3.5.0
PDF Version
 
arp.h
Go to the documentation of this file.
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
23#ifndef _NB_ARP_H
24#define _NB_ARP_H
25
26#include <buffers.h>
27#include <nettypes.h>
28#include <stdio.h>
29
30/*
31 ******************************************************************************
32 *
33 * Runtime Libraries Routine Prototypes
34 *
35 ******************************************************************************
36 */
37
43void ShowArp();
44
52void fShowArp(FILE *fp);
53
68
80void sendGratuitousArp(int interfaceNumber, IPADDR4 ip);
81
82/*INTERNAL FUNCTIONS */
83void processArp(PoolPtr p, PEFRAME pF);
84
85void AddCheckArp(MACADR *ma, IPADDR4 ip, int ifnum);
86void DeleteArpFromIp(IPADDR4 ip);
87
88void RouteOut(PEFRAME pf, IPADDR4 ip, PoolPtr p);
89void RouteOutVia(PEFRAME pf, IPADDR4 ipfrom, IPADDR4 ipto, PoolPtr p, int intf);
90
91void AgeArp();
92void AddStaticArp(MACADR *ma, IPADDR4 ip, int ifnum);
93
94void InitializeArp();
95
96BOOL IsMyAddressUsedArpDetect(uint16_t timeout, int interface = 0);
97
98int GetProperInterface4(IPADDR4 dst);
99
100/*******************************************************************************
101 *
102 * Data Structures
103 *
104 *******************************************************************************/
105
106/*******************************************************************************
107
108 Address Resolution Protocol (ARP) Packet Structure
109
110 hard_Type - Hardware type (HTYPE)
111 prot_Type - Protocol type (PTYPE)
112 hard_size - Hardware length (HLEN)
113
114 theMac - Interface ethernet MAC address
115 Notes:
116 Should not change data sizes and always add to the end to avoid breaking
117 use for interface configuration.
118
119 *******************************************************************************/
120typedef struct
121{
122 beuint16_t hard_Type;
123 beuint16_t prot_Type;
124 uint8_t hard_size;
125 uint8_t prot_size;
126 beuint16_t op_code;
127 MACADR sender_phy;
128 IPADDR4 sender_Ip;
129 MACADR target_phy;
130 IPADDR4 target_Ip;
131} __attribute__((packed)) ARP;
132
133typedef ARP *PARP;
134
135#endif
136
NetBurner Buffers API.
Used to store and manipulate IPv4 addresses in dual stack mode.
Definition nettypes.h:208
Used to store and manipulate MAC addresses.
Definition nettypes.h:69
void sendGratuitousArp(int interfaceNumber, IPADDR4 ip)
Send Gratuitous ARP Request.
void fShowArp(FILE *fp)
Display ARP cache, output will be sent to the specified file pointer.
BOOL GetArpMacFromIp(IPADDR4 ip, MACADR &ma)
Check to see if the specified IP address is in the ARP cache.
void ShowArp()
Display ARP cache, output will be the stdio serial port.
NetBurner IPADDR4 Class. See the IPADDR4 Class page for complete documentation.