~ubuntu-branches/ubuntu/hardy/nast/hardy

« back to all changes in this revision

Viewing changes to include/ARPhdr.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2004-02-17 22:14:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040217221421-f1h39tzviblbp2lh
Tags: upstream-0.2.0
ImportĀ upstreamĀ versionĀ 0.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    nast
 
3
 
 
4
    This program is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or
 
7
    (at your option) any later version.
 
8
 
 
9
    This program is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
    GNU General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU General Public License
 
15
    along with this program; if not, write to the Free Software
 
16
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 
 
18
*/
 
19
 
 
20
/* See RFC 826 for protocol description.  ARP packets are variable
 
21
   in size; the arphdr structure defines the fixed-length portion.
 
22
   Protocol type values are the same as those for 10 Mb/s Ethernet.
 
23
   It is followed by the variable-sized fields ar_sha, arp_spa,
 
24
   arp_tha and arp_tpa in that order, according to the lengths
 
25
   specified.  Field names used correspond to RFC 826.  */
 
26
 
 
27
struct nast_arp_hdr
 
28
{
 
29
   unsigned short int ar_hrd;           /* Format of hardware address.  */
 
30
   unsigned short int ar_pro;           /* Format of protocol address.  */
 
31
   unsigned char ar_hln;                /* Length of hardware address.  */
 
32
   unsigned char ar_pln;                /* Length of protocol address.  */
 
33
   unsigned short int ar_op;            /* ARP opcode (command).  */
 
34
 
 
35
   unsigned char __ar_sha[ETHER_ADDR_LEN];      /* Sender hardware address.  */
 
36
   unsigned char __ar_sip[4];           /* Sender IP address.  */
 
37
   unsigned char __ar_tha[ETHER_ADDR_LEN];      /* Target hardware address.  */
 
38
   unsigned char __ar_tip[4];           /* Target IP address.  */
 
39
 
 
40
   /* ARP protocol opcodes. */
 
41
   #define      ARPOP_REQUEST           1               /* ARP request.  */
 
42
   #define      ARPOP_REPLY             2               /* ARP reply.  */
 
43
   #define      ARPOP_RREQUEST          3               /* RARP request.  */
 
44
   #define      ARPOP_RREPLY            4               /* RARP reply.  */
 
45
   #define      ARPOP_InREQUEST         8               /* InARP request.  */
 
46
   #define      ARPOP_InREPLY           9               /* InARP reply.  */
 
47
   #define      ARPOP_NAK               10
 
48
 
 
49
};
 
50