OpenCores
URL https://opencores.org/ocsvn/1g_ethernet_dpi/1g_ethernet_dpi/trunk

Subversion Repositories 1g_ethernet_dpi

[/] [1g_ethernet_dpi/] [trunk/] [sw/] [dev/] [test_main/] [src/] [net/] [arp.h] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 kuzmi4
#ifndef _ARP_H_
2
#define _ARP_H_
3
 
4
#ifdef __cplusplus
5
extern "C"
6
{
7
#endif// __cplusplus
8
 
9
#include "xil_types.h"
10
#include "tri_mode_emac.h" // tmemac_cfg_t
11
 
12
#include "eth.h" // _packed_struct
13
#include "net.h" // net_if_t
14
 
15
// ??
16
#define ARP_SZ      (64)
17
 
18
// APR-proto definitions / net endian
19
#define ETH_ARP     htons(0x0806)   // Eth-Protocol-Type
20
#define ARP_HW_ETH  htons(1)        // arp hardware type for ethernet
21
#define ARP_IPv4    htons(0x0800)   // IPv4 type
22
#define ARP_REQ     htons(1)        // byte swapped request opcode
23
#define ARP_RESP    htons(2)        // byte swapped reply opcode
24
// tbd
25
struct arp_hdr_ {
26
    u16     ar_hd;      /* hardware type */
27
    u16     ar_pro;     /* protcol type */
28
    u8      ar_hln;     /* hardware addr length */
29
    u8      ar_pln;     /* protocol header length */
30
    u16     ar_op;      /* opcode */
31
    u8      ar_sha[6];  /* sender hardware address */
32
    u32     ar_spa;     /* sender protocol address */
33
    u8      ar_tha[6];  /* target hardware address */
34
    u32     ar_tpa;     /* target protocol address */
35
} _packed_struct;
36
typedef struct arp_hdr_ arp_hdr_t;
37
 
38
// Ext:
39
void eth_arp_init(net_if_t *ip_net_if);
40
void eth_arp(char *iv_data);
41
 
42
#ifdef __cplusplus
43
}
44
#endif// __cplusplus
45
 
46
#endif   // _ARP_H_

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.