source: rtems/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.h @ 9a85541

4.104.114.95
Last change on this file since 9a85541 was 9a85541, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/08 at 16:31:41

2008-08-20 Joel Sherrill <joel.sherrill@…>

  • block/block.c, console/console.c, dswifi/arm9/source/sgIP.h, dswifi/arm9/source/sgIP_ARP.h, dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.h, dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h, dswifi/include/dswifi7.h, dswifi/include/dswifi9.h, fb/fb.c, include/my_ipc.h, libfat/source/disc_io/disc_io.h, libfat/source/disc_io/io_nmmc.c, libnds/include/nds/arm9/exceptions.h, libnds/include/nds/arm9/input.h, libnds/include/nds/arm9/ndsmotion.h, libnds/include/nds/arm9/videoGL.h, libnds/source/arm9/console.c, libnds/source/arm9/gurumeditation.c, libnds/source/arm9/ndsmotion.c, libnds/source/common/card.c, libnds/source/common/interrupts.c, sound/sound.c, startup/start.c, touchscreen/reco.h, wifi/compat.c, wifi/compat.h: Fix most warnings.
  • Property mode set to 100644
File size: 3.0 KB
Line 
1// DSWifi Project - sgIP Internet Protocol Stack Implementation
2// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
3/******************************************************************************
4DSWifi Lib and test materials are licenced under the MIT open source licence:
5Copyright (c) 2005-2006 Stephen Stair
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of
8this software and associated documentation files (the "Software"), to deal in
9the Software without restriction, including without limitation the rights to
10use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11of the Software, and to permit persons to whom the Software is furnished to do
12so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24******************************************************************************/
25#ifndef SGIP_ARP_H
26#define SGIP_ARP_H
27
28#include "sgIP_Config.h"
29#include "sgIP_memblock.h"
30#include "sgIP_Hub.h"
31
32#define SGIP_ARP_FLAG_ACTIVE            0x0001
33#define SGIP_ARP_FLAG_HAVEHWADDR        0x0002
34
35typedef struct SGIP_ARP_RECORD {
36        unsigned short flags, retrycount;
37        unsigned long idletime;
38        sgIP_Hub_HWInterface * linked_interface;
39        sgIP_memblock * queued_packet;
40        int linked_protocol;
41        unsigned long protocol_address;
42        char hw_address[SGIP_MAXHWADDRLEN];
43} sgIP_ARP_Record;
44
45
46typedef struct SGIP_HEADER_ARP {
47        unsigned short hwspace;         // ethernet=1;
48        unsigned short protocol;
49        unsigned char hw_addr_len;
50        unsigned char protocol_addr_len;
51        unsigned short opcode;          // request=1, reply=2
52        unsigned char addresses[8+12]; // sender HW, sender Protocol, dest HW, dest Protocol
53} sgIP_Header_ARP;
54
55#define SGIP_HEADER_ARP_BASESIZE        8
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61        extern void     sgIP_ARP_Init(void);
62        extern void sgIP_ARP_Timer100ms(void);
63        extern void sgIP_ARP_FlushInterface(sgIP_Hub_HWInterface * hw);
64
65        extern int sgIP_ARP_ProcessIPFrame(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb);
66        extern int sgIP_ARP_ProcessARPFrame(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb);
67        extern int sgIP_ARP_SendProtocolFrame(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb, unsigned short protocol, unsigned long destaddr);
68       
69        extern int sgIP_ARP_SendARPResponse(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb);
70        extern int sgIP_ARP_SendGratARP(sgIP_Hub_HWInterface * hw);
71        extern int sgIP_ARP_SendARPRequest(sgIP_Hub_HWInterface * hw, int protocol, unsigned long protocol_addr);
72       
73
74
75#ifdef __cplusplus
76};
77#endif
78
79
80#endif
Note: See TracBrowser for help on using the repository browser.