[2229] | 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 : ip.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 IP Header File |
---|
| 25 | // |
---|
| 26 | // $Id: ip.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 _IP_H |
---|
| 35 | #define _IP_H |
---|
| 36 | |
---|
| 37 | #ifdef __cplusplus |
---|
| 38 | extern "C" { |
---|
| 39 | #endif |
---|
| 40 | |
---|
| 41 | // ip header structure |
---|
| 42 | struct xilnet_ip_hdr { |
---|
| 43 | unsigned char version:4, |
---|
| 44 | hdr_len:4; |
---|
| 45 | unsigned char tos; |
---|
| 46 | unsigned short total_len; |
---|
| 47 | unsigned short ident; |
---|
| 48 | unsigned short frag_off; |
---|
| 49 | unsigned char ttl; |
---|
| 50 | unsigned char prot; |
---|
| 51 | unsigned short check_sum; |
---|
| 52 | unsigned int src_ip; |
---|
| 53 | unsigned int dst_ip; |
---|
| 54 | }; |
---|
| 55 | |
---|
| 56 | #define IP_VERSION 4 /* 4 for IPV4 */ |
---|
| 57 | #define IP_HDR_LEN 5 /* no. of 32-bit words in header */ |
---|
| 58 | #define IP_TOS 0x00 /* 0x00 is the tos val for tftp */ |
---|
| 59 | #define IP_TOTAL_LEN 0x0220 /* 544 bytes is the max length of ip datagram for TFTP */ |
---|
| 60 | #define IP_IDENT 0x006F /* 111 is the value for no fragmentation */ |
---|
| 61 | #define IP_FRAG_OFF 0x0000 /* No fragmentation - 0x0000 */ |
---|
| 62 | #define IP_TTL 0x20 /* 32 hops */ |
---|
| 63 | |
---|
| 64 | #define IP_DADDR_BASE 16 |
---|
| 65 | #define IP_SADDR_BASE 12 |
---|
| 66 | |
---|
| 67 | #define IP_PROTO_TCP 0x06 /* Xilnet does not support TCP connections */ |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | #ifdef __cplusplus |
---|
| 71 | } |
---|
| 72 | #endif |
---|
| 73 | |
---|
| 74 | #endif /* _SYS_IP_H */ |
---|