source: edk_user_repository/WARP/sw_services/WARPxilnet_v3_03_a/src/xilnet_arp.h

Last change on this file was 2229, checked in by welsh, 11 years ago

Added WARPxilnet version 3.03.a

File size: 2.8 KB
Line 
1////////////////////////////////////////////////////////////////////////////////
2// Copyright (c) 2004 Xilinx, Inc.  All rights reserved.
3//
4// Xilinx, Inc.
5// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
6// COURTESY TO YOU.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
7// ONE POSSIBLE   IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
8// STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
9// IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
10// FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
11// XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
12// THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
13// ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
14// FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
15// AND FITNESS FOR A PARTICULAR PURPOSE.
16//
17// File   : arp.h
18// Date   : 2002, March 20.
19// Author : Sathya Thammanur
20// Company: Xilinx
21// Group  : Emerging Software Technologies
22//
23// Summary:
24// Header file for ARP
25//
26// $Id: arp.h,v 1.2.8.6 2005/11/15 23:41:10 salindac Exp $
27//
28////////////////////////////////////////////////////////////////////////////////
29
30////////////////////////////////////////////////////////////////////////////////
31// see copyright.txt for Rice University/Mango Communications modifications
32////////////////////////////////////////////////////////////////////////////////
33
34#ifndef _ARP_H
35#define _ARP_H
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#include <xilnet_eth.h>
42
43/* ARP hardware types */
44
45#define ARP_HARD_TYPE_ETH    0x01  /* ethernet hardware address */
46#define ARP_HARD_SIZE        0x06  /* ethernet address size  */
47#define ARP_PROTO_IP_SIZE    0x04  /* ip address size */
48#define ARP_PAD_SIZE         18    /* no.of bytes to be padded in arp pkt */ 
49
50
51/* ARP operation codes */
52#define ARP_REQ     1    /* ARP request */
53#define ARP_REPLY   2    /* ARP reply   */
54
55#define ARP_SIP_OFFSET    14
56#define ARP_DIP_OFFSET    24
57
58/*
59 *  This structure defines an ethernet arp header.
60 */
61
62struct xilnet_arp_hdr
63{
64  unsigned short hard_type;   /* type of hardware address */
65  unsigned short prot_type;   /* type of protocol address */   
66  unsigned char hard_size;    /* hardware address size */
67  unsigned char prot_size;    /* protocol address size */   
68  unsigned short op;          /* arp opcode */
69};
70
71struct xilnet_arp_pkt
72{
73  struct xilnet_arp_hdr  hdr;           /* arp header */
74  unsigned char sender_hw[ETH_ADDR_LEN];     /* sender hardware address */
75  unsigned char sender_ip[4];            /* sender IP address       */
76  unsigned char target_hw[ETH_ADDR_LEN];     /* target hardware address */
77  unsigned char target_ip[4];            /* target IP address       */
78  unsigned char pad[18];                 /* pad with 0 for min eth frame requirement */
79};
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif  /* _ARP_H */
Note: See TracBrowser for help on using the repository browser.