37 lines
745 B
C
37 lines
745 B
C
//
|
|
// Created by epagris on 2022.12.08..
|
|
//
|
|
|
|
#ifndef ETHERLIB_TEST_ARP_PACKET_H
|
|
#define ETHERLIB_TEST_ARP_PACKET_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#define ETH_ARP_PACKET_CLASS (0x0806)
|
|
|
|
/**
|
|
* Arp operations
|
|
*/
|
|
typedef enum {
|
|
ARPOP_REQ = 1, ///< ARP Request
|
|
ARPOP_REP = 2 ///< ARP Reply
|
|
} ArpOp;
|
|
|
|
typedef enum {
|
|
ARP_HWTYPE_ETHERNET = 1
|
|
} ArpHwType;
|
|
|
|
/**
|
|
* ARP properties.
|
|
*/
|
|
typedef struct {
|
|
uint16_t HTYPE; ///< Hardware type (Ethernet: 1)
|
|
uint16_t PTYPE; ///< Protocol type (IP: 0x0800)
|
|
uint8_t HLEN; ///< Hardware address length
|
|
uint8_t PLEN; ///< Protocol address length
|
|
uint16_t OPER; ///< Operation
|
|
uint16_t addr[]; ///< Array of addresses (SHA, SPA, THA, TPA)
|
|
} ArpProps;
|
|
|
|
#endif //ETHERLIB_TEST_ARP_PACKET_H
|