File: netherneth.inc

package info (click to toggle)
fpc 2.0.0-4
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 89,476 kB
  • ctags: 133,433
  • sloc: pascal: 1,075,377; makefile: 310,704; xml: 64,343; perl: 7,703; yacc: 3,297; ansic: 2,265; lex: 839; php: 447; sh: 412; sed: 132; asm: 71; csh: 34; cpp: 26; tcl: 7
file content (46 lines) | stat: -rw-r--r-- 1,116 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46


type
   Pether_addr = ^ether_addr;
   ether_addr = record
        ether_addr_octet : array[0..(ETH_ALEN)-1] of u_int8_t;
     end;

   Pether_header = ^ether_header;
   ether_header = record
        ether_dhost : array[0..(ETH_ALEN)-1] of u_int8_t;
        ether_shost : array[0..(ETH_ALEN)-1] of u_int8_t;
        ether_type : u_int16_t;
     end;


const
   ETHERTYPE_PUP = $0200;
   ETHERTYPE_IP = $0800;
   ETHERTYPE_ARP = $0806;
   ETHERTYPE_REVARP = $8035;
   ETHER_ADDR_LEN = ETH_ALEN;
   ETHER_TYPE_LEN = 2;
   ETHER_CRC_LEN = 4;
   ETHER_HDR_LEN = ETH_HLEN;
   ETHER_MIN_LEN = ETH_ZLEN + ETHER_CRC_LEN;
   ETHER_MAX_LEN = ETH_FRAME_LEN + ETHER_CRC_LEN;

function ETHER_IS_VALID_LEN(foo : cardinal) : boolean;


const
   ETHERTYPE_TRAIL = $1000;
   ETHERTYPE_NTRAILER = 16;
   ETHERMTU = ETH_DATA_LEN;
   ETHERMIN = (ETHER_MIN_LEN - ETHER_HDR_LEN) - ETHER_CRC_LEN;

{ ---------------------------------------------------------------------
    Borland compatibility types
  ---------------------------------------------------------------------}

Type
  TEtherAddr = ether_addr;
  PEtherAddr = ^TEtherAddr;