mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
Add Makefile.libogc
This commit is contained in:
parent
3a46538680
commit
7156de52c4
269
Makefile.libogc
Normal file
269
Makefile.libogc
Normal file
@ -0,0 +1,269 @@
|
||||
#---------------------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro")
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||
endif
|
||||
|
||||
export PATH := $(DEVKITPPC)/bin:$(PATH)
|
||||
|
||||
export LIBOGC_MAJOR := 1
|
||||
export LIBOGC_MINOR := 8
|
||||
export LIBOGC_PATCH := 17
|
||||
|
||||
include $(DEVKITPPC)/base_rules
|
||||
|
||||
BUILD := build
|
||||
|
||||
DATESTRING := $(shell date +%Y%m%d)
|
||||
VERSTRING := $(LIBOGC_MAJOR).$(LIBOGC_MINOR).$(LIBOGC_PATCH)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(PLATFORM)),)
|
||||
#---------------------------------------------------------------------------------
|
||||
export BASEDIR := $(CURDIR)
|
||||
export LWIPDIR := $(BASEDIR)/wii/libogc/lwip
|
||||
export OGCDIR := $(BASEDIR)/wii/libogc/libogc
|
||||
export DBDIR := $(BASEDIR)/wii/libogc/libdb
|
||||
export BTEDIR := $(BASEDIR)/wii/libogc/lwbt
|
||||
export WIIUSEDIR := $(BASEDIR)/wii/libogc/wiiuse
|
||||
export LIBWIIKEYB := $(BASEDIR)/wii/libogc/libwiikeyboard
|
||||
export STUBSDIR := $(BASEDIR)/wii/libogc/lockstubs
|
||||
export DEPS := $(BASEDIR)/wii/libogc/deps
|
||||
export LIBS := $(BASEDIR)/wii/libogc/libs
|
||||
|
||||
export INCDIR := $(BASEDIR)/wii/libogc/include
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
else
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
export LIBDIR := $(LIBS)/$(PLATFORM)
|
||||
export DEPSDIR := $(DEPS)/$(PLATFORM)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
endif
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
BBALIB := $(LIBDIR)/libbba
|
||||
OGCLIB := $(LIBDIR)/libogc
|
||||
DBLIB := $(LIBDIR)/libdb
|
||||
BTELIB := $(LIBDIR)/libbte
|
||||
WIIUSELIB := $(LIBDIR)/libwiiuse
|
||||
WIIKEYBLIB := $(LIBDIR)/libwiikeyboard
|
||||
STUBSLIB := $(LIBDIR)/libgclibstubs
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
DEFAULTINCDIR := $(BASEDIR)/wii/libogc/include
|
||||
DEFINCS := -I$(DEFAULTINCDIR)
|
||||
INCLUDES := $(DEFINCS) \
|
||||
-I$(BASEDIR)/wii/libogc \
|
||||
-I$(DEFAULTINCDIR)/netif \
|
||||
-I$(DEFAULTINCDIR)/ipv4 \
|
||||
-I$(DEFAULTINCDIR)/sdcard \
|
||||
-I$(DEFAULTINCDIR)/ogc \
|
||||
-I$(DEFAULTINCDIR)/ogc/machine \
|
||||
-I$(DEFAULTINCDIR)/bte \
|
||||
-I$(DEFAULTINCDIR)/sdcard \
|
||||
-I$(DEFAULTINCDIR)/wiikeyboard \
|
||||
-I$(DEFAULTINCDIR)/wiiuse \
|
||||
-I$(DEFAULTINCDIR)/di
|
||||
|
||||
MACHDEP := -DBIGENDIAN -DGEKKO -mcpu=750 -meabi -msdata=eabi -mhard-float -ffunction-sections -fdata-sections
|
||||
|
||||
|
||||
ifeq ($(PLATFORM),wii)
|
||||
MACHDEP += -DHW_RVL
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),cube)
|
||||
MACHDEP += -DHW_DOL
|
||||
endif
|
||||
|
||||
CFLAGS := -DLIBOGC_INTERNAL -g -O2 -fno-strict-aliasing -mregnames -Wall $(MACHDEP) $(INCLUDES)
|
||||
ASFLAGS := $(MACHDEP) -mregnames -D_LANGUAGE_ASSEMBLY $(INCLUDES)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
VPATH := $(LWIPDIR) \
|
||||
$(LWIPDIR)/arch/gc \
|
||||
$(LWIPDIR)/arch/gc/netif \
|
||||
$(LWIPDIR)/core \
|
||||
$(LWIPDIR)/core/ipv4 \
|
||||
$(LWIPDIR)/netif \
|
||||
$(OGCDIR) \
|
||||
$(DBDIR) \
|
||||
$(DBDIR)/uIP \
|
||||
$(BTEDIR) \
|
||||
$(WIIUSEDIR) \
|
||||
$(SDCARDDIR) \
|
||||
$(LIBWIIKEYB) \
|
||||
$(STUBSDIR)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
LWIPOBJ := network.o netio.o gcif.o \
|
||||
inet.o mem.o dhcp.o raw.o \
|
||||
memp.o netif.o pbuf.o stats.o \
|
||||
sys.o tcp.o tcp_in.o tcp_out.o \
|
||||
udp.o icmp.o ip.o ip_frag.o \
|
||||
ip_addr.o etharp.o loopif.o
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
OGCOBJ := \
|
||||
console.o lwp_priority.o lwp_queue.o lwp_threadq.o lwp_threads.o lwp_sema.o \
|
||||
lwp_messages.o lwp.o lwp_handler.o lwp_stack.o lwp_mutex.o \
|
||||
lwp_watchdog.o lwp_wkspace.o lwp_objmgr.o lwp_heap.o sys_state.o \
|
||||
exception_handler.o exception.o irq.o irq_handler.o semaphore.o \
|
||||
video_asm.o video.o pad.o dvd.o exi.o mutex.o arqueue.o arqmgr.o \
|
||||
cache_asm.o system.o system_asm.o cond.o \
|
||||
gx.o gu.o gu_psasm.o audio.o cache.o decrementer.o \
|
||||
message.o card.o aram.o depackrnc.o decrementer_handler.o \
|
||||
depackrnc1.o dsp.o si.o tpl.o ipc.o ogc_crt0.o \
|
||||
console_font_8x16.o timesupp.o lock_supp.o newlibc.o usbgecko.o usbmouse.o \
|
||||
sbrk.o malloc_lock.o kprintf.o stm.o ios.o es.o isfs.o usb.o network_common.o \
|
||||
sdgecko_io.o sdgecko_buf.o gcsd.o argv.o network_wii.o wiisd.o conf.o usbstorage.o \
|
||||
texconv.o wiilaunch.o
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
DBOBJ := uip_ip.o uip_tcp.o uip_pbuf.o uip_netif.o uip_arp.o uip_arch.o \
|
||||
uip_icmp.o memb.o memr.o bba.o tcpip.o debug.o debug_handler.o \
|
||||
debug_supp.o geckousb.o
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
BTEOBJ := bte.o hci.o l2cap.o btmemb.o btmemr.o btpbuf.o physbusif.o
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
WIIUSEOBJ := classic.o dynamics.o events.o io.o io_wii.o ir.o \
|
||||
nunchuk.o wiiuse.o speaker.o wpad.o motion_plus.o
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
WIIKEYBLIBOBJ := usbkeyboard.o keyboard.o ukbdmap.o wskbdutil.o
|
||||
|
||||
|
||||
|
||||
all: wii cube
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
wii: $(BASEDIR)/wii/libogc/include/ogc/libversion.h
|
||||
#---------------------------------------------------------------------------------
|
||||
@[ -d $(INCDIR) ] || mkdir -p $(INCDIR)
|
||||
@[ -d $(LIBS)/wii ] || mkdir -p $(LIBS)/wii
|
||||
@[ -d $(DEPS)/wii ] || mkdir -p $(DEPS)/wii
|
||||
@[ -d wii ] || mkdir -p wii
|
||||
@$(MAKE) PLATFORM=wii libs -C wii -f $(CURDIR)/Makefile.libogc
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
cube: $(BASEDIR)/wii/libogc/include/ogc/libversion.h
|
||||
#---------------------------------------------------------------------------------
|
||||
@[ -d $(INCDIR) ] || mkdir -p $(INCDIR)
|
||||
@[ -d $(LIBS)/cube ] || mkdir -p $(LIBS)/cube
|
||||
@[ -d $(DEPS)/cube ] || mkdir -p $(DEPS)/cube
|
||||
@[ -d cube ] || mkdir -p cube
|
||||
@$(MAKE) PLATFORM=cube libs -C cube -f $(CURDIR)/Makefile.libogc
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BASEDIR)/wii/libogc/include/ogc/libversion.h : Makefile.libogc
|
||||
#---------------------------------------------------------------------------------
|
||||
@echo "#ifndef __LIBVERSION_H__" > $@
|
||||
@echo "#define __LIBVERSION_H__" >> $@
|
||||
@echo >> $@
|
||||
@echo "#define _V_MAJOR_ $(LIBOGC_MAJOR)" >> $@
|
||||
@echo "#define _V_MINOR_ $(LIBOGC_MINOR)" >> $@
|
||||
@echo "#define _V_PATCH_ $(LIBOGC_PATCH)" >> $@
|
||||
@echo >> $@
|
||||
@echo "#define _V_DATE_ __DATE__" >> $@
|
||||
@echo "#define _V_TIME_ __TIME__" >> $@
|
||||
@echo >> $@
|
||||
@echo '#define _V_STRING "libOGC Release '$(LIBOGC_MAJOR).$(LIBOGC_MINOR).$(LIBOGC_PATCH)'"' >> $@
|
||||
@echo >> $@
|
||||
@echo "#endif // __LIBVERSION_H__" >> $@
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BBALIB).a: $(LWIPOBJ)
|
||||
#---------------------------------------------------------------------------------
|
||||
$(OGCLIB).a: $(OGCOBJ)
|
||||
#---------------------------------------------------------------------------------
|
||||
$(DBLIB).a: $(DBOBJ)
|
||||
#---------------------------------------------------------------------------------
|
||||
$(WIIKEYBLIB).a: $(WIIKEYBLIBOBJ)
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BTELIB).a: $(BTEOBJ)
|
||||
#---------------------------------------------------------------------------------
|
||||
$(WIIUSELIB).a: $(WIIUSEOBJ)
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
.PHONY: libs wii cube install-headers install dist docs
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
install-headers:
|
||||
#---------------------------------------------------------------------------------
|
||||
@mkdir -p $(INCDIR)
|
||||
@mkdir -p $(INCDIR)/ogc/machine
|
||||
@mkdir -p $(INCDIR)/bte
|
||||
@mkdir -p $(INCDIR)/wiiuse
|
||||
@mkdir -p $(INCDIR)/modplay
|
||||
@mkdir -p $(INCDIR)/sdcard
|
||||
@mkdir -p $(INCDIR)/di
|
||||
@mkdir -p $(INCDIR)/wiikeyboard
|
||||
@cp ./gc/*.h $(INCDIR)
|
||||
@cp ./gc/ogc/*.h $(INCDIR)/ogc
|
||||
@cp ./gc/ogc/machine/*.h $(INCDIR)/ogc/machine
|
||||
@cp ./gc/bte/*.h $(INCDIR)/bte
|
||||
@cp ./gc/wiiuse/*.h $(INCDIR)/wiiuse
|
||||
@cp ./gc/modplay/*.h $(INCDIR)/modplay
|
||||
@cp ./gc/sdcard/*.h $(INCDIR)/sdcard
|
||||
@cp ./gc/di/*.h $(INCDIR)/di
|
||||
@cp ./gc/wiikeyboard/*.h $(INCDIR)/wiikeyboard
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
install: wii cube install-headers
|
||||
#---------------------------------------------------------------------------------
|
||||
@mkdir -p $(DEVKITPRO)/libogc
|
||||
@cp -frv include $(DEVKITPRO)/libogc
|
||||
@cp -frv lib $(DEVKITPRO)/libogc
|
||||
@cp -frv libogc_license.txt $(DEVKITPRO)/libogc
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
dist: wii cube install-headers
|
||||
#---------------------------------------------------------------------------------
|
||||
@tar --exclude=*CVS* --exclude=.svn --exclude=wii --exclude=cube --exclude=*deps* \
|
||||
--exclude=*.bz2 --exclude=*include* --exclude=*lib/* --exclude=*docs/*\
|
||||
-cvjf libogc-src-$(VERSTRING).tar.bz2 *
|
||||
@tar -cvjf libogc-$(VERSTRING).tar.bz2 include lib libogc_license.txt
|
||||
|
||||
|
||||
LIBRARIES := $(OGCLIB).a $(DBLIB).a
|
||||
|
||||
ifeq ($(PLATFORM),cube)
|
||||
LIBRARIES += $(BBALIB).a
|
||||
endif
|
||||
ifeq ($(PLATFORM),wii)
|
||||
LIBRARIES += $(BTELIB).a $(WIIUSELIB).a $(WIIKEYBLIB).a
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
libs: $(LIBRARIES)
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
clean:
|
||||
#---------------------------------------------------------------------------------
|
||||
rm -fr $(LIBS)
|
||||
rm -fr $(BASEDIR)/wii/*.o
|
||||
rm -f *.map
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
docs: install-headers
|
||||
#---------------------------------------------------------------------------------
|
||||
doxygen libogc.dox
|
||||
|
||||
-include $(DEPSDIR)/*.d
|
133
wii/libogc/include/di/di.h
Normal file
133
wii/libogc/include/di/di.h
Normal file
@ -0,0 +1,133 @@
|
||||
/*-------------------------------------------------------------
|
||||
|
||||
di.h -- Drive Interface library
|
||||
|
||||
Team Twiizers
|
||||
Copyright (C) 2008
|
||||
|
||||
Erant
|
||||
marcan
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
-------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
All buffers in this document need to be 32-byte aligned!
|
||||
*/
|
||||
|
||||
#ifndef __DI_H__
|
||||
#define __DI_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ogc/ipc.h>
|
||||
#include <ogc/disc_io.h>
|
||||
|
||||
#define DVD_IDENTIFY 0x12
|
||||
#define DVD_READ_DISCID 0x70
|
||||
#define DVD_LOW_READ 0x71
|
||||
#define DVD_WAITFORCOVERCLOSE 0x79
|
||||
#define DVD_READ_PHYSICAL 0x80
|
||||
#define DVD_READ_COPYRIGHT 0x81
|
||||
#define DVD_READ_DISCKEY 0x82
|
||||
#define DVD_GETCOVER 0x88
|
||||
#define DVD_RESET 0x8A
|
||||
#define DVD_OPEN_PARTITION 0x8B
|
||||
#define DVD_CLOSE_PARTITION 0x8C
|
||||
#define DVD_READ_UNENCRYPTED 0x8D
|
||||
#define DVD_REPORTKEY 0xA4
|
||||
#define DVD_READ 0xD0
|
||||
#define DVD_READ_CONFIG 0xD1
|
||||
#define DVD_READ_BCA 0xDA
|
||||
#define DVD_GET_ERROR 0xE0
|
||||
#define DVD_SET_MOTOR 0xE3
|
||||
|
||||
#define DVD_READY 0x1
|
||||
#define DVD_INIT 0x2
|
||||
#define DVD_UNKNOWN 0x4
|
||||
#define DVD_NO_DISC 0x8
|
||||
#define DVD_IOS_ERROR 0x10
|
||||
#define DVD_D0 0x20
|
||||
#define DVD_A8 0x40
|
||||
|
||||
#define DVD_COVER_DISC_INSERTED 0x02
|
||||
|
||||
#define LIBDI_MAX_RETRIES 16
|
||||
|
||||
#define DEVICE_TYPE_WII_DVD (('W'<<24)|('D'<<16)|('V'<<8)|'D')
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct{
|
||||
uint16_t rev;
|
||||
uint16_t dev_code;
|
||||
uint32_t rel_date;
|
||||
}DI_DriveID;
|
||||
|
||||
typedef int(*di_callback)(uint32_t status, uint32_t error);
|
||||
typedef int(*read_func)(void*,uint32_t,uint32_t);
|
||||
typedef int(*read_func_async)(void*,uint32_t,uint32_t,ipccallback);
|
||||
|
||||
extern int di_fd;
|
||||
extern const DISC_INTERFACE __io_wiidvd;
|
||||
|
||||
int DI_Init();
|
||||
void DI_LoadDVDX(bool load);
|
||||
void DI_UseCache(bool use);
|
||||
void DI_SetInitCallback(di_callback cb);
|
||||
void DI_Mount();
|
||||
void DI_Close();
|
||||
int DI_GetStatus();
|
||||
|
||||
int DI_Identify(DI_DriveID* id);
|
||||
int DI_CheckDVDSupport();
|
||||
int DI_ReadDiscID(u64 *id);
|
||||
int DI_GetError(uint32_t* error);
|
||||
int DI_GetCoverRegister(uint32_t* status);
|
||||
int DI_Reset();
|
||||
|
||||
int DI_StopMotor();
|
||||
int DI_Eject();
|
||||
int DI_KillDrive();
|
||||
|
||||
int DI_ReadDVD(void* buf, uint32_t len, uint32_t lba);
|
||||
int DI_ReadDVDAsync(void* buf, uint32_t len, uint32_t lba, ipccallback ipc_cb);
|
||||
|
||||
int DI_Read(void *buf, u32 size, u32 offset);
|
||||
int DI_UnencryptedRead(void *buf, u32 size, u32 offset);
|
||||
|
||||
int DI_ReadDVDConfig(uint32_t* val, uint32_t flag);
|
||||
int DI_ReadDVDCopyright(uint32_t* copyright);
|
||||
int DI_ReadDVDDiscKey(void *buf);
|
||||
int DI_ReadDVDPhysical(void *buf);
|
||||
int DI_Read_BCA(void *buf);
|
||||
int DI_ReportKey(int keytype, uint32_t lba, void* buf);
|
||||
|
||||
int DI_OpenPartition(u32 offset);
|
||||
int DI_ClosePartition(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
112
wii/libogc/include/ipv4/lwip/icmp.h
Normal file
112
wii/libogc/include/ipv4/lwip/icmp.h
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_ICMP_H__
|
||||
#define __LWIP_ICMP_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/pbuf.h"
|
||||
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
#define ICMP_ER 0 /* echo reply */
|
||||
#define ICMP_DUR 3 /* destination unreachable */
|
||||
#define ICMP_SQ 4 /* source quench */
|
||||
#define ICMP_RD 5 /* redirect */
|
||||
#define ICMP_ECHO 8 /* echo */
|
||||
#define ICMP_TE 11 /* time exceeded */
|
||||
#define ICMP_PP 12 /* parameter problem */
|
||||
#define ICMP_TS 13 /* timestamp */
|
||||
#define ICMP_TSR 14 /* timestamp reply */
|
||||
#define ICMP_IRQ 15 /* information request */
|
||||
#define ICMP_IR 16 /* information reply */
|
||||
|
||||
enum icmp_dur_type {
|
||||
ICMP_DUR_NET = 0, /* net unreachable */
|
||||
ICMP_DUR_HOST = 1, /* host unreachable */
|
||||
ICMP_DUR_PROTO = 2, /* protocol unreachable */
|
||||
ICMP_DUR_PORT = 3, /* port unreachable */
|
||||
ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */
|
||||
ICMP_DUR_SR = 5 /* source route failed */
|
||||
};
|
||||
|
||||
enum icmp_te_type {
|
||||
ICMP_TE_TTL = 0, /* time to live exceeded in transit */
|
||||
ICMP_TE_FRAG = 1 /* fragment reassembly time exceeded */
|
||||
};
|
||||
|
||||
void icmp_input(struct pbuf *p, struct netif *inp);
|
||||
|
||||
void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t);
|
||||
void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct icmp_echo_hdr {
|
||||
PACK_STRUCT_FIELD(u16_t _type_code);
|
||||
PACK_STRUCT_FIELD(u16_t chksum);
|
||||
PACK_STRUCT_FIELD(u16_t id);
|
||||
PACK_STRUCT_FIELD(u16_t seqno);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
|
||||
PACK_STRUCT_BEGIN
|
||||
struct icmp_dur_hdr {
|
||||
PACK_STRUCT_FIELD(u16_t _type_code);
|
||||
PACK_STRUCT_FIELD(u16_t chksum);
|
||||
PACK_STRUCT_FIELD(u32_t unused);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
|
||||
PACK_STRUCT_BEGIN
|
||||
struct icmp_te_hdr {
|
||||
PACK_STRUCT_FIELD(u16_t _type_code);
|
||||
PACK_STRUCT_FIELD(u16_t chksum);
|
||||
PACK_STRUCT_FIELD(u32_t unused);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#define ICMPH_TYPE(hdr) (ntohs((hdr)->_type_code) >> 8)
|
||||
#define ICMPH_CODE(hdr) (ntohs((hdr)->_type_code) & 0xff)
|
||||
|
||||
#define ICMPH_TYPE_SET(hdr, type) ((hdr)->_type_code = htons(ICMPH_CODE(hdr) | ((type) << 8)))
|
||||
#define ICMPH_CODE_SET(hdr, code) ((hdr)->_type_code = htons((code) | (ICMPH_TYPE(hdr) << 8)))
|
||||
|
||||
#endif /* __LWIP_ICMP_H__ */
|
||||
|
87
wii/libogc/include/ipv4/lwip/inet.h
Normal file
87
wii/libogc/include/ipv4/lwip/inet.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_INET_H__
|
||||
#define __LWIP_INET_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
u16_t inet_chksum(void *dataptr, u16_t len);
|
||||
#if 0 /* optimized routine */
|
||||
u16_t inet_chksum4(u8_t *dataptr, u16_t len);
|
||||
#endif
|
||||
u16_t inet_chksum_pbuf(struct pbuf *p);
|
||||
u16_t inet_chksum_pseudo(struct pbuf *p,
|
||||
struct ip_addr *src, struct ip_addr *dest,
|
||||
u8_t proto, u16_t proto_len);
|
||||
|
||||
u32_t inet_addr(const char *cp);
|
||||
s8_t inet_aton(const char *cp, struct in_addr *addr);
|
||||
char *inet_ntoa(struct in_addr addr); /* returns ptr to static buffer; not reentrant! */
|
||||
|
||||
#ifdef htons
|
||||
#undef htons
|
||||
#endif /* htons */
|
||||
#ifdef htonl
|
||||
#undef htonl
|
||||
#endif /* htonl */
|
||||
#ifdef ntohs
|
||||
#undef ntohs
|
||||
#endif /* ntohs */
|
||||
#ifdef ntohl
|
||||
#undef ntohl
|
||||
#endif /* ntohl */
|
||||
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
#define htons(x) (x)
|
||||
#define ntohs(x) (x)
|
||||
#define htonl(x) (x)
|
||||
#define ntohl(x) (x)
|
||||
#else
|
||||
#ifdef LWIP_PREFIX_BYTEORDER_FUNCS
|
||||
/* workaround for naming collisions on some platforms */
|
||||
#define htons lwip_htons
|
||||
#define ntohs lwip_ntohs
|
||||
#define htonl lwip_htonl
|
||||
#define ntohl lwip_ntohl
|
||||
#endif
|
||||
u16_t htons(u16_t x);
|
||||
u16_t ntohs(u16_t x);
|
||||
u32_t htonl(u32_t x);
|
||||
u32_t ntohl(u32_t x);
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_INET_H__ */
|
||||
|
154
wii/libogc/include/ipv4/lwip/ip.h
Normal file
154
wii/libogc/include/ipv4/lwip/ip.h
Normal file
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_IP_H__
|
||||
#define __LWIP_IP_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
|
||||
void ip_init(void);
|
||||
struct netif *ip_route(struct ip_addr *dest);
|
||||
err_t ip_input(struct pbuf *p, struct netif *inp);
|
||||
err_t ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
|
||||
u8_t ttl, u8_t tos, u8_t proto);
|
||||
err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
|
||||
u8_t ttl, u8_t tos, u8_t proto,
|
||||
struct netif *netif);
|
||||
|
||||
#define IP_HLEN 20
|
||||
|
||||
#define IP_PROTO_ICMP 1
|
||||
#define IP_PROTO_UDP 17
|
||||
#define IP_PROTO_UDPLITE 170
|
||||
#define IP_PROTO_TCP 6
|
||||
|
||||
/* This is passed as the destination address to ip_output_if (not
|
||||
to ip_output), meaning that an IP header already is constructed
|
||||
in the pbuf. This is used when TCP retransmits. */
|
||||
#ifdef IP_HDRINCL
|
||||
#undef IP_HDRINCL
|
||||
#endif /* IP_HDRINCL */
|
||||
#define IP_HDRINCL NULL
|
||||
|
||||
|
||||
/* This is the common part of all PCB types. It needs to be at the
|
||||
beginning of a PCB type definition. It is located here so that
|
||||
changes to this common part are made in one location instead of
|
||||
having to change all PCB structs. */
|
||||
#define IP_PCB struct ip_addr local_ip; \
|
||||
struct ip_addr remote_ip; \
|
||||
/* Socket options */ \
|
||||
u16_t so_options; \
|
||||
/* Type Of Service */ \
|
||||
u8_t tos; \
|
||||
/* Time To Live */ \
|
||||
u8_t ttl
|
||||
|
||||
/*
|
||||
* Option flags per-socket. These are the same like SO_XXX.
|
||||
*/
|
||||
#define SOF_DEBUG (u16_t)0x0001U /* turn on debugging info recording */
|
||||
#define SOF_ACCEPTCONN (u16_t)0x0002U /* socket has had listen() */
|
||||
#define SOF_REUSEADDR (u16_t)0x0004U /* allow local address reuse */
|
||||
#define SOF_KEEPALIVE (u16_t)0x0008U /* keep connections alive */
|
||||
#define SOF_DONTROUTE (u16_t)0x0010U /* just use interface addresses */
|
||||
#define SOF_BROADCAST (u16_t)0x0020U /* permit sending of broadcast msgs */
|
||||
#define SOF_USELOOPBACK (u16_t)0x0040U /* bypass hardware when possible */
|
||||
#define SOF_LINGER (u16_t)0x0080U /* linger on close if data present */
|
||||
#define SOF_OOBINLINE (u16_t)0x0100U /* leave received OOB data in line */
|
||||
#define SOF_REUSEPORT (u16_t)0x0200U /* allow local address & port reuse */
|
||||
|
||||
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct ip_hdr {
|
||||
/* version / header length / type of service */
|
||||
PACK_STRUCT_FIELD(u16_t _v_hl_tos);
|
||||
/* total length */
|
||||
PACK_STRUCT_FIELD(u16_t _len);
|
||||
/* identification */
|
||||
PACK_STRUCT_FIELD(u16_t _id);
|
||||
/* fragment offset field */
|
||||
PACK_STRUCT_FIELD(u16_t _offset);
|
||||
#define IP_RF 0x8000 /* reserved fragment flag */
|
||||
#define IP_DF 0x4000 /* dont fragment flag */
|
||||
#define IP_MF 0x2000 /* more fragments flag */
|
||||
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
|
||||
/* time to live / protocol*/
|
||||
PACK_STRUCT_FIELD(u16_t _ttl_proto);
|
||||
/* checksum */
|
||||
PACK_STRUCT_FIELD(u16_t _chksum);
|
||||
/* source and destination IP addresses */
|
||||
PACK_STRUCT_FIELD(struct ip_addr src);
|
||||
PACK_STRUCT_FIELD(struct ip_addr dest);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#define IPH_V(hdr) (ntohs((hdr)->_v_hl_tos) >> 12)
|
||||
#define IPH_HL(hdr) ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f)
|
||||
#define IPH_TOS(hdr) (ntohs((hdr)->_v_hl_tos) & 0xff)
|
||||
#define IPH_LEN(hdr) ((hdr)->_len)
|
||||
#define IPH_ID(hdr) ((hdr)->_id)
|
||||
#define IPH_OFFSET(hdr) ((hdr)->_offset)
|
||||
#define IPH_TTL(hdr) (ntohs((hdr)->_ttl_proto) >> 8)
|
||||
#define IPH_PROTO(hdr) (ntohs((hdr)->_ttl_proto) & 0xff)
|
||||
#define IPH_CHKSUM(hdr) ((hdr)->_chksum)
|
||||
|
||||
#define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = (htons(((v) << 12) | ((hl) << 8) | (tos)))
|
||||
#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len)
|
||||
#define IPH_ID_SET(hdr, id) (hdr)->_id = (id)
|
||||
#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off)
|
||||
#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = (htons(IPH_PROTO(hdr) | ((ttl) << 8)))
|
||||
#define IPH_PROTO_SET(hdr, proto) (hdr)->_ttl_proto = (htons((proto) | (IPH_TTL(hdr) << 8)))
|
||||
#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum)
|
||||
|
||||
#if IP_DEBUG
|
||||
void ip_debug_print(struct pbuf *p);
|
||||
#else
|
||||
#define ip_debug_print(p)
|
||||
#endif /* IP_DEBUG */
|
||||
|
||||
#endif /* __LWIP_IP_H__ */
|
||||
|
||||
|
162
wii/libogc/include/ipv4/lwip/ip_addr.h
Normal file
162
wii/libogc/include/ipv4/lwip/ip_addr.h
Normal file
@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_IP_ADDR_H__
|
||||
#define __LWIP_IP_ADDR_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct ip_addr {
|
||||
PACK_STRUCT_FIELD(u32_t addr);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct ip_addr2 {
|
||||
PACK_STRUCT_FIELD(u16_t addrw[2]);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
/* For compatibility with BSD code */
|
||||
#ifndef HAVE_IN_ADDR
|
||||
#define HAVE_IN_ADDR
|
||||
struct in_addr {
|
||||
u32_t s_addr;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct netif;
|
||||
|
||||
extern const struct ip_addr ip_addr_any;
|
||||
extern const struct ip_addr ip_addr_broadcast;
|
||||
|
||||
/** IP_ADDR_ can be used as a fixed IP address
|
||||
* for the wildcard and the broadcast address
|
||||
*/
|
||||
#define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any)
|
||||
#define IP_ADDR_BROADCAST ((struct ip_addr *)&ip_addr_broadcast)
|
||||
|
||||
#define INADDR_NONE ((u32_t) 0xffffffff) /* 255.255.255.255 */
|
||||
#define INADDR_LOOPBACK ((u32_t) 0x7f000001) /* 127.0.0.1 */
|
||||
|
||||
/* Definitions of the bits in an Internet address integer.
|
||||
|
||||
On subnets, host and network parts are found according to
|
||||
the subnet mask, not these masks. */
|
||||
|
||||
#define IN_CLASSA(a) ((((u32_t)(a)) & 0x80000000) == 0)
|
||||
#define IN_CLASSA_NET 0xff000000
|
||||
#define IN_CLASSA_NSHIFT 24
|
||||
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
|
||||
#define IN_CLASSA_MAX 128
|
||||
|
||||
#define IN_CLASSB(a) ((((u32_t)(a)) & 0xc0000000) == 0x80000000)
|
||||
#define IN_CLASSB_NET 0xffff0000
|
||||
#define IN_CLASSB_NSHIFT 16
|
||||
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
|
||||
#define IN_CLASSB_MAX 65536
|
||||
|
||||
#define IN_CLASSC(a) ((((u32_t)(a)) & 0xe0000000) == 0xc0000000)
|
||||
#define IN_CLASSC_NET 0xffffff00
|
||||
#define IN_CLASSC_NSHIFT 8
|
||||
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
|
||||
|
||||
#define IN_CLASSD(a) (((u32_t)(a) & 0xf0000000) == 0xe0000000)
|
||||
#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
|
||||
#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
|
||||
#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
|
||||
#define IN_MULTICAST(a) IN_CLASSD(a)
|
||||
|
||||
#define IN_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000) == 0xf0000000)
|
||||
#define IN_BADCLASS(a) (((u32_t)(a) & 0xf0000000) == 0xf0000000)
|
||||
|
||||
#define IN_LOOPBACKNET 127 /* official! */
|
||||
|
||||
|
||||
#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = htonl(((u32_t)(a & 0xff) << 24) | ((u32_t)(b & 0xff) << 16) | \
|
||||
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff))
|
||||
|
||||
#define ip_addr_set(dest, src) (dest)->addr = \
|
||||
((src) == NULL? 0:\
|
||||
(src)->addr)
|
||||
/**
|
||||
* Determine if two address are on the same network.
|
||||
*
|
||||
* @arg addr1 IP address 1
|
||||
* @arg addr2 IP address 2
|
||||
* @arg mask network identifier mask
|
||||
* @return !0 if the network identifiers of both address match
|
||||
*/
|
||||
#define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \
|
||||
(mask)->addr) == \
|
||||
((addr2)->addr & \
|
||||
(mask)->addr))
|
||||
#define ip_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr)
|
||||
|
||||
#define ip_addr_isany(addr1) ((addr1) == NULL || (addr1)->addr == 0)
|
||||
|
||||
u8_t ip_addr_isbroadcast(struct ip_addr *, struct netif *);
|
||||
|
||||
#define ip_addr_ismulticast(addr1) (((addr1)->addr & ntohl(0xf0000000)) == ntohl(0xe0000000))
|
||||
|
||||
|
||||
#define ip_addr_debug_print(debug, ipaddr) LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F, \
|
||||
ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff:0, \
|
||||
ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff:0, \
|
||||
ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff:0, \
|
||||
ipaddr?(u16_t)ntohl((ipaddr)->addr) & 0xff:0U))
|
||||
|
||||
/* cast to unsigned int, as it is used as argument to printf functions
|
||||
* which expect integer arguments. CSi: use cc.h formatters (conversion chars)! */
|
||||
#define ip4_addr1(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff)
|
||||
#define ip4_addr2(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff)
|
||||
#define ip4_addr3(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff)
|
||||
#define ip4_addr4(ipaddr) ((u16_t)(ntohl((ipaddr)->addr)) & 0xff)
|
||||
#endif /* __LWIP_IP_ADDR_H__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
47
wii/libogc/include/ipv4/lwip/ip_frag.h
Normal file
47
wii/libogc/include/ipv4/lwip/ip_frag.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Jani Monoses <jani@iv.ro>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LWIP_IP_FRAG_H__
|
||||
#define __LWIP_IP_FRAG_H__
|
||||
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
void ip_reass_tmr(void);
|
||||
struct pbuf * ip_reass(struct pbuf *p);
|
||||
err_t ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest);
|
||||
|
||||
#endif /* __LWIP_IP_FRAG_H__ */
|
||||
|
||||
|
101
wii/libogc/include/lwip/api.h
Normal file
101
wii/libogc/include/lwip/api.h
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_API_H__
|
||||
#define __LWIP_API_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "lwip/ip.h"
|
||||
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
#define NETCONN_NOCOPY 0x00
|
||||
#define NETCONN_COPY 0x01
|
||||
|
||||
enum netconn_type {
|
||||
NETCONN_TCP,
|
||||
NETCONN_UDP,
|
||||
NETCONN_UDPLITE,
|
||||
NETCONN_UDPNOCHKSUM,
|
||||
NETCONN_RAW
|
||||
};
|
||||
|
||||
enum netconn_state {
|
||||
NETCONN_NONE,
|
||||
NETCONN_WRITE,
|
||||
NETCONN_ACCEPT,
|
||||
NETCONN_RECV,
|
||||
NETCONN_CONNECT,
|
||||
NETCONN_CLOSE
|
||||
};
|
||||
|
||||
enum netconn_evt {
|
||||
NETCONN_EVTRCVPLUS,
|
||||
NETCONN_EVTRCVMINUS,
|
||||
NETCONN_EVTSENDPLUS,
|
||||
NETCONN_EVTSENDMINUS
|
||||
};
|
||||
|
||||
struct netbuf {
|
||||
struct pbuf *p, *ptr;
|
||||
struct ip_addr *fromaddr;
|
||||
u16_t fromport;
|
||||
err_t err;
|
||||
};
|
||||
|
||||
struct netconn {
|
||||
enum netconn_type type;
|
||||
enum netconn_state state;
|
||||
union {
|
||||
struct tcp_pcb *tcp;
|
||||
struct udp_pcb *udp;
|
||||
struct raw_pcb *raw;
|
||||
} pcb;
|
||||
err_t err;
|
||||
sys_sem sem;
|
||||
sys_mbox mbox;
|
||||
sys_mbox recvmbox;
|
||||
sys_mbox acceptmbox;
|
||||
u16 recvavail;
|
||||
s32 socket;
|
||||
void (*callback)(struct netconn *,enum netconn_evt,u32);
|
||||
};
|
||||
|
||||
#endif /* __LWIP_API_H__ */
|
||||
|
||||
|
86
wii/libogc/include/lwip/api_msg.h
Normal file
86
wii/libogc/include/lwip/api_msg.h
Normal file
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_API_MSG_H__
|
||||
#define __LWIP_API_MSG_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "lwip/ip.h"
|
||||
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
|
||||
#include "lwip/api.h"
|
||||
|
||||
enum apimsg_type {
|
||||
APIMSG_NEWCONN,
|
||||
APIMSG_DELCONN,
|
||||
APIMSG_BIND,
|
||||
APIMSG_CONNECT,
|
||||
APIMSG_DISCONNECT,
|
||||
APIMSG_LISTEN,
|
||||
APIMSG_ACCEPT,
|
||||
APIMSG_SEND,
|
||||
APIMSG_RECV,
|
||||
APIMSG_WRITE,
|
||||
APIMSG_CLOSE,
|
||||
APIMSG_MAX
|
||||
};
|
||||
|
||||
struct apimsg_msg {
|
||||
struct netconn *conn;
|
||||
enum netconn_type type;
|
||||
union {
|
||||
struct pbuf *p;
|
||||
struct {
|
||||
struct ip_addr *ipaddr;
|
||||
u16 port;
|
||||
} bc;
|
||||
struct {
|
||||
void *dataptr;
|
||||
u32 len;
|
||||
u8 copy;
|
||||
} w;
|
||||
sys_mbox mbox;
|
||||
u16 len;
|
||||
} msg;
|
||||
};
|
||||
|
||||
struct api_msg {
|
||||
enum apimsg_type type;
|
||||
struct apimsg_msg msg;
|
||||
};
|
||||
|
||||
#endif /* __LWIP_API_MSG_H__ */
|
||||
|
216
wii/libogc/include/lwip/arch.h
Normal file
216
wii/libogc/include/lwip/arch.h
Normal file
@ -0,0 +1,216 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_ARCH_H__
|
||||
#define __LWIP_ARCH_H__
|
||||
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
|
||||
#include "arch/cc.h"
|
||||
|
||||
#ifndef PACK_STRUCT_BEGIN
|
||||
#define PACK_STRUCT_BEGIN
|
||||
#endif /* PACK_STRUCT_BEGIN */
|
||||
|
||||
#ifndef PACK_STRUCT_END
|
||||
#define PACK_STRUCT_END
|
||||
#endif /* PACK_STRUCT_END */
|
||||
|
||||
#ifndef PACK_STRUCT_FIELD
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
#endif /* PACK_STRUCT_FIELD */
|
||||
|
||||
|
||||
|
||||
#ifdef LWIP_PROVIDE_ERRNO
|
||||
|
||||
#define EPERM 1 /* Operation not permitted */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
#define ESRCH 3 /* No such process */
|
||||
#define EINTR 4 /* Interrupted system call */
|
||||
#define EIO 5 /* I/O error */
|
||||
#define ENXIO 6 /* No such device or address */
|
||||
#define E2BIG 7 /* Arg list too long */
|
||||
#define ENOEXEC 8 /* Exec format error */
|
||||
#define EBADF 9 /* Bad file number */
|
||||
#define ECHILD 10 /* No child processes */
|
||||
#define EAGAIN 11 /* Try again */
|
||||
#define ENOMEM 12 /* Out of memory */
|
||||
#define EACCES 13 /* Permission denied */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
#define ENOTBLK 15 /* Block device required */
|
||||
#define EBUSY 16 /* Device or resource busy */
|
||||
#define EEXIST 17 /* File exists */
|
||||
#define EXDEV 18 /* Cross-device link */
|
||||
#define ENODEV 19 /* No such device */
|
||||
#define ENOTDIR 20 /* Not a directory */
|
||||
#define EISDIR 21 /* Is a directory */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENFILE 23 /* File table overflow */
|
||||
#define EMFILE 24 /* Too many open files */
|
||||
#define ENOTTY 25 /* Not a typewriter */
|
||||
#define ETXTBSY 26 /* Text file busy */
|
||||
#define EFBIG 27 /* File too large */
|
||||
#define ENOSPC 28 /* No space left on device */
|
||||
#define ESPIPE 29 /* Illegal seek */
|
||||
#define EROFS 30 /* Read-only file system */
|
||||
#define EMLINK 31 /* Too many links */
|
||||
#define EPIPE 32 /* Broken pipe */
|
||||
#define EDOM 33 /* Math argument out of domain of func */
|
||||
#define ERANGE 34 /* Math result not representable */
|
||||
#define EDEADLK 35 /* Resource deadlock would occur */
|
||||
#define ENAMETOOLONG 36 /* File name too long */
|
||||
#define ENOLCK 37 /* No record locks available */
|
||||
#define ENOSYS 38 /* Function not implemented */
|
||||
#define ENOTEMPTY 39 /* Directory not empty */
|
||||
#define ELOOP 40 /* Too many symbolic links encountered */
|
||||
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
||||
#define ENOMSG 42 /* No message of desired type */
|
||||
#define EIDRM 43 /* Identifier removed */
|
||||
#define ECHRNG 44 /* Channel number out of range */
|
||||
#define EL2NSYNC 45 /* Level 2 not synchronized */
|
||||
#define EL3HLT 46 /* Level 3 halted */
|
||||
#define EL3RST 47 /* Level 3 reset */
|
||||
#define ELNRNG 48 /* Link number out of range */
|
||||
#define EUNATCH 49 /* Protocol driver not attached */
|
||||
#define ENOCSI 50 /* No CSI structure available */
|
||||
#define EL2HLT 51 /* Level 2 halted */
|
||||
#define EBADE 52 /* Invalid exchange */
|
||||
#define EBADR 53 /* Invalid request descriptor */
|
||||
#define EXFULL 54 /* Exchange full */
|
||||
#define ENOANO 55 /* No anode */
|
||||
#define EBADRQC 56 /* Invalid request code */
|
||||
#define EBADSLT 57 /* Invalid slot */
|
||||
|
||||
#define EDEADLOCK EDEADLK
|
||||
|
||||
#define EBFONT 59 /* Bad font file format */
|
||||
#define ENOSTR 60 /* Device not a stream */
|
||||
#define ENODATA 61 /* No data available */
|
||||
#define ETIME 62 /* Timer expired */
|
||||
#define ENOSR 63 /* Out of streams resources */
|
||||
#define ENONET 64 /* Machine is not on the network */
|
||||
#define ENOPKG 65 /* Package not installed */
|
||||
#define EREMOTE 66 /* Object is remote */
|
||||
#define ENOLINK 67 /* Link has been severed */
|
||||
#define EADV 68 /* Advertise error */
|
||||
#define ESRMNT 69 /* Srmount error */
|
||||
#define ECOMM 70 /* Communication error on send */
|
||||
#define EPROTO 71 /* Protocol error */
|
||||
#define EMULTIHOP 72 /* Multihop attempted */
|
||||
#define EDOTDOT 73 /* RFS specific error */
|
||||
#define EBADMSG 74 /* Not a data message */
|
||||
#define EOVERFLOW 75 /* Value too large for defined data type */
|
||||
#define ENOTUNIQ 76 /* Name not unique on network */
|
||||
#define EBADFD 77 /* File descriptor in bad state */
|
||||
#define EREMCHG 78 /* Remote address changed */
|
||||
#define ELIBACC 79 /* Can not access a needed shared library */
|
||||
#define ELIBBAD 80 /* Accessing a corrupted shared library */
|
||||
#define ELIBSCN 81 /* .lib section in a.out corrupted */
|
||||
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
|
||||
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
|
||||
#define EILSEQ 84 /* Illegal byte sequence */
|
||||
#define ERESTART 85 /* Interrupted system call should be restarted */
|
||||
#define ESTRPIPE 86 /* Streams pipe error */
|
||||
#define EUSERS 87 /* Too many users */
|
||||
#define ENOTSOCK 88 /* Socket operation on non-socket */
|
||||
#define EDESTADDRREQ 89 /* Destination address required */
|
||||
#define EMSGSIZE 90 /* Message too long */
|
||||
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
|
||||
#define ENOPROTOOPT 92 /* Protocol not available */
|
||||
#define EPROTONOSUPPORT 93 /* Protocol not supported */
|
||||
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
|
||||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
||||
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
||||
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
|
||||
#define EADDRINUSE 98 /* Address already in use */
|
||||
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
|
||||
#define ENETDOWN 100 /* Network is down */
|
||||
#define ENETUNREACH 101 /* Network is unreachable */
|
||||
#define ENETRESET 102 /* Network dropped connection because of reset */
|
||||
#define ECONNABORTED 103 /* Software caused connection abort */
|
||||
#define ECONNRESET 104 /* Connection reset by peer */
|
||||
#define ENOBUFS 105 /* No buffer space available */
|
||||
#define EISCONN 106 /* Transport endpoint is already connected */
|
||||
#define ENOTCONN 107 /* Transport endpoint is not connected */
|
||||
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
|
||||
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
|
||||
#define ETIMEDOUT 110 /* Connection timed out */
|
||||
#define ECONNREFUSED 111 /* Connection refused */
|
||||
#define EHOSTDOWN 112 /* Host is down */
|
||||
#define EHOSTUNREACH 113 /* No route to host */
|
||||
#define EALREADY 114 /* Operation already in progress */
|
||||
#define EINPROGRESS 115 /* Operation now in progress */
|
||||
#define ESTALE 116 /* Stale NFS file handle */
|
||||
#define EUCLEAN 117 /* Structure needs cleaning */
|
||||
#define ENOTNAM 118 /* Not a XENIX named type file */
|
||||
#define ENAVAIL 119 /* No XENIX semaphores available */
|
||||
#define EISNAM 120 /* Is a named type file */
|
||||
#define EREMOTEIO 121 /* Remote I/O error */
|
||||
#define EDQUOT 122 /* Quota exceeded */
|
||||
|
||||
#define ENOMEDIUM 123 /* No medium found */
|
||||
#define EMEDIUMTYPE 124 /* Wrong medium type */
|
||||
|
||||
|
||||
#define ENSROK 0 /* DNS server returned answer with no data */
|
||||
#define ENSRNODATA 160 /* DNS server returned answer with no data */
|
||||
#define ENSRFORMERR 161 /* DNS server claims query was misformatted */
|
||||
#define ENSRSERVFAIL 162 /* DNS server returned general failure */
|
||||
#define ENSRNOTFOUND 163 /* Domain name not found */
|
||||
#define ENSRNOTIMP 164 /* DNS server does not implement requested operation */
|
||||
#define ENSRREFUSED 165 /* DNS server refused query */
|
||||
#define ENSRBADQUERY 166 /* Misformatted DNS query */
|
||||
#define ENSRBADNAME 167 /* Misformatted domain name */
|
||||
#define ENSRBADFAMILY 168 /* Unsupported address family */
|
||||
#define ENSRBADRESP 169 /* Misformatted DNS reply */
|
||||
#define ENSRCONNREFUSED 170 /* Could not contact DNS servers */
|
||||
#define ENSRTIMEOUT 171 /* Timeout while contacting DNS servers */
|
||||
#define ENSROF 172 /* End of file */
|
||||
#define ENSRFILE 173 /* Error reading file */
|
||||
#define ENSRNOMEM 174 /* Out of memory */
|
||||
#define ENSRDESTRUCTION 175 /* Application terminated lookup */
|
||||
#define ENSRQUERYDOMAINTOOLONG 176 /* Domain name is too long */
|
||||
#define ENSRCNAMELOOP 177 /* Domain name is too long */
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_PROVIDE_ERRNO */
|
||||
|
||||
#endif /* __LWIP_ARCH_H__ */
|
90
wii/libogc/include/lwip/debug.h
Normal file
90
wii/libogc/include/lwip/debug.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_DEBUG_H__
|
||||
#define __LWIP_DEBUG_H__
|
||||
|
||||
#include "arch/cc.h"
|
||||
|
||||
/** lower two bits indicate debug level
|
||||
* - 0 off
|
||||
* - 1 warning
|
||||
* - 2 serious
|
||||
* - 3 severe
|
||||
*/
|
||||
|
||||
#define DBG_LEVEL_OFF 0
|
||||
#define DBG_LEVEL_WARNING 1 /* bad checksums, dropped packets, ... */
|
||||
#define DBG_LEVEL_SERIOUS 2 /* memory allocation failures, ... */
|
||||
#define DBG_LEVEL_SEVERE 3 /* */
|
||||
#define DBG_MASK_LEVEL 3
|
||||
|
||||
/** flag for LWIP_DEBUGF to enable that debug message */
|
||||
#define DBG_ON 0x80U
|
||||
/** flag for LWIP_DEBUGF to disable that debug message */
|
||||
#define DBG_OFF 0x00U
|
||||
|
||||
/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */
|
||||
#define DBG_TRACE 0x40U
|
||||
/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */
|
||||
#define DBG_STATE 0x20U
|
||||
/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */
|
||||
#define DBG_FRESH 0x10U
|
||||
/** flag for LWIP_DEBUGF to halt after printing this debug message */
|
||||
#define DBG_HALT 0x08U
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
# ifndef LWIP_NOASSERT
|
||||
# define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x); } while(0)
|
||||
# else
|
||||
# define LWIP_ASSERT(x,y)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
/** print debug message only if debug message type is enabled...
|
||||
* AND is of correct type AND is at least DBG_LEVEL
|
||||
*/
|
||||
# define LWIP_DEBUGF(debug,x) do { if (((debug) & DBG_ON) && ((debug) & DBG_TYPES_ON) && ((int)((debug) & DBG_MASK_LEVEL) >= DBG_MIN_LEVEL)) { LWIP_PLATFORM_DIAG(x); if ((debug) & DBG_HALT) while(1); } } while(0)
|
||||
# define LWIP_ERROR(x) do { LWIP_PLATFORM_DIAG(x); } while(0)
|
||||
#else /* LWIP_DEBUG */
|
||||
# define LWIP_ASSERT(x,y)
|
||||
# define LWIP_DEBUGF(debug,x)
|
||||
# define LWIP_ERROR(x)
|
||||
#endif /* LWIP_DEBUG */
|
||||
|
||||
#endif /* __LWIP_DEBUG_H__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
47
wii/libogc/include/lwip/def.h
Normal file
47
wii/libogc/include/lwip/def.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_DEF_H__
|
||||
#define __LWIP_DEF_H__
|
||||
|
||||
/* this might define NULL already */
|
||||
#include "arch/cc.h"
|
||||
|
||||
#define LWIP_MAX(x , y) (x) > (y) ? (x) : (y)
|
||||
#define LWIP_MIN(x , y) (x) < (y) ? (x) : (y)
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __LWIP_DEF_H__ */
|
||||
|
223
wii/libogc/include/lwip/dhcp.h
Normal file
223
wii/libogc/include/lwip/dhcp.h
Normal file
@ -0,0 +1,223 @@
|
||||
/** @file
|
||||
*/
|
||||
|
||||
#ifndef __LWIP_DHCP_H__
|
||||
#define __LWIP_DHCP_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/udp.h"
|
||||
|
||||
/** period (in seconds) of the application calling dhcp_coarse_tmr() */
|
||||
#define DHCP_COARSE_TIMER_SECS 60
|
||||
/** period (in milliseconds) of the application calling dhcp_fine_tmr() */
|
||||
#define DHCP_FINE_TIMER_MSECS 500
|
||||
|
||||
struct dhcp
|
||||
{
|
||||
/** current DHCP state machine state */
|
||||
u8_t state;
|
||||
/** retries of current request */
|
||||
u8_t tries;
|
||||
/** transaction identifier of last sent request */
|
||||
u32_t xid;
|
||||
/** our connection to the DHCP server */
|
||||
struct udp_pcb *pcb;
|
||||
/** (first) pbuf of incoming msg */
|
||||
struct pbuf *p;
|
||||
/** incoming msg */
|
||||
struct dhcp_msg *msg_in;
|
||||
/** incoming msg options */
|
||||
struct dhcp_msg *options_in;
|
||||
/** ingoing msg options length */
|
||||
u16_t options_in_len;
|
||||
|
||||
struct pbuf *p_out; /* pbuf of outcoming msg */
|
||||
struct dhcp_msg *msg_out; /* outgoing msg */
|
||||
u16_t options_out_len; /* outgoing msg options length */
|
||||
u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */
|
||||
u16_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */
|
||||
u16_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */
|
||||
struct ip_addr server_ip_addr; /* dhcp server address that offered this lease */
|
||||
struct ip_addr offered_ip_addr;
|
||||
struct ip_addr offered_sn_mask;
|
||||
struct ip_addr offered_gw_addr;
|
||||
struct ip_addr offered_bc_addr;
|
||||
#define DHCP_MAX_DNS 2
|
||||
u32_t dns_count; /* actual number of DNS servers obtained */
|
||||
struct ip_addr offered_dns_addr[DHCP_MAX_DNS]; /* DNS server addresses */
|
||||
|
||||
u32_t offered_t0_lease; /* lease period (in seconds) */
|
||||
u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */
|
||||
u32_t offered_t2_rebind; /* recommended rebind time (usually 66% of lease period) */
|
||||
/** Patch #1308
|
||||
* TODO: See dhcp.c "TODO"s
|
||||
*/
|
||||
#if 0
|
||||
struct ip_addr offered_si_addr;
|
||||
u8_t *boot_file_name;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* MUST be compiled with "pack structs" or equivalent! */
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
/** minimum set of fields of any DHCP message */
|
||||
struct dhcp_msg
|
||||
{
|
||||
PACK_STRUCT_FIELD(u8_t op);
|
||||
PACK_STRUCT_FIELD(u8_t htype);
|
||||
PACK_STRUCT_FIELD(u8_t hlen);
|
||||
PACK_STRUCT_FIELD(u8_t hops);
|
||||
PACK_STRUCT_FIELD(u32_t xid);
|
||||
PACK_STRUCT_FIELD(u16_t secs);
|
||||
PACK_STRUCT_FIELD(u16_t flags);
|
||||
PACK_STRUCT_FIELD(struct ip_addr ciaddr);
|
||||
PACK_STRUCT_FIELD(struct ip_addr yiaddr);
|
||||
PACK_STRUCT_FIELD(struct ip_addr siaddr);
|
||||
PACK_STRUCT_FIELD(struct ip_addr giaddr);
|
||||
#define DHCP_CHADDR_LEN 16U
|
||||
PACK_STRUCT_FIELD(u8_t chaddr[DHCP_CHADDR_LEN]);
|
||||
#define DHCP_SNAME_LEN 64U
|
||||
PACK_STRUCT_FIELD(u8_t sname[DHCP_SNAME_LEN]);
|
||||
#define DHCP_FILE_LEN 128U
|
||||
PACK_STRUCT_FIELD(u8_t file[DHCP_FILE_LEN]);
|
||||
PACK_STRUCT_FIELD(u32_t cookie);
|
||||
#define DHCP_MIN_OPTIONS_LEN 68U
|
||||
/** make sure user does not configure this too small */
|
||||
#if ((defined(DHCP_OPTIONS_LEN)) && (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN))
|
||||
# undef DHCP_OPTIONS_LEN
|
||||
#endif
|
||||
/** allow this to be configured in lwipopts.h, but not too small */
|
||||
#if (!defined(DHCP_OPTIONS_LEN))
|
||||
/** set this to be sufficient for your options in outgoing DHCP msgs */
|
||||
# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN
|
||||
#endif
|
||||
PACK_STRUCT_FIELD(u8_t options[DHCP_OPTIONS_LEN]);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
/** start DHCP configuration */
|
||||
err_t dhcp_start(struct netif *netif);
|
||||
/** enforce early lease renewal (not needed normally)*/
|
||||
err_t dhcp_renew(struct netif *netif);
|
||||
/** release the DHCP lease, usually called before dhcp_stop()*/
|
||||
err_t dhcp_release(struct netif *netif);
|
||||
/** stop DHCP configuration */
|
||||
void dhcp_stop(struct netif *netif);
|
||||
/** inform server of our manual IP address */
|
||||
void dhcp_inform(struct netif *netif);
|
||||
|
||||
/** if enabled, check whether the offered IP address is not in use, using ARP */
|
||||
#if DHCP_DOES_ARP_CHECK
|
||||
void dhcp_arp_reply(struct netif *netif, struct ip_addr *addr);
|
||||
#endif
|
||||
|
||||
/** to be called every minute */
|
||||
void dhcp_coarse_tmr(void);
|
||||
/** to be called every half second */
|
||||
void dhcp_fine_tmr(void);
|
||||
|
||||
/** DHCP message item offsets and length */
|
||||
#define DHCP_MSG_OFS (UDP_DATA_OFS)
|
||||
#define DHCP_OP_OFS (DHCP_MSG_OFS + 0)
|
||||
#define DHCP_HTYPE_OFS (DHCP_MSG_OFS + 1)
|
||||
#define DHCP_HLEN_OFS (DHCP_MSG_OFS + 2)
|
||||
#define DHCP_HOPS_OFS (DHCP_MSG_OFS + 3)
|
||||
#define DHCP_XID_OFS (DHCP_MSG_OFS + 4)
|
||||
#define DHCP_SECS_OFS (DHCP_MSG_OFS + 8)
|
||||
#define DHCP_FLAGS_OFS (DHCP_MSG_OFS + 10)
|
||||
#define DHCP_CIADDR_OFS (DHCP_MSG_OFS + 12)
|
||||
#define DHCP_YIADDR_OFS (DHCP_MSG_OFS + 16)
|
||||
#define DHCP_SIADDR_OFS (DHCP_MSG_OFS + 20)
|
||||
#define DHCP_GIADDR_OFS (DHCP_MSG_OFS + 24)
|
||||
#define DHCP_CHADDR_OFS (DHCP_MSG_OFS + 28)
|
||||
#define DHCP_SNAME_OFS (DHCP_MSG_OFS + 44)
|
||||
#define DHCP_FILE_OFS (DHCP_MSG_OFS + 108)
|
||||
#define DHCP_MSG_LEN 236
|
||||
|
||||
#define DHCP_COOKIE_OFS (DHCP_MSG_OFS + DHCP_MSG_LEN)
|
||||
#define DHCP_OPTIONS_OFS (DHCP_MSG_OFS + DHCP_MSG_LEN + 4)
|
||||
|
||||
#define DHCP_CLIENT_PORT 68
|
||||
#define DHCP_SERVER_PORT 67
|
||||
|
||||
/** DHCP client states */
|
||||
#define DHCP_REQUESTING 1
|
||||
#define DHCP_INIT 2
|
||||
#define DHCP_REBOOTING 3
|
||||
#define DHCP_REBINDING 4
|
||||
#define DHCP_RENEWING 5
|
||||
#define DHCP_SELECTING 6
|
||||
#define DHCP_INFORMING 7
|
||||
#define DHCP_CHECKING 8
|
||||
#define DHCP_PERMANENT 9
|
||||
#define DHCP_BOUND 10
|
||||
/** not yet implemented #define DHCP_RELEASING 11 */
|
||||
#define DHCP_BACKING_OFF 12
|
||||
#define DHCP_OFF 13
|
||||
|
||||
#define DHCP_BOOTREQUEST 1
|
||||
#define DHCP_BOOTREPLY 2
|
||||
|
||||
#define DHCP_DISCOVER 1
|
||||
#define DHCP_OFFER 2
|
||||
#define DHCP_REQUEST 3
|
||||
#define DHCP_DECLINE 4
|
||||
#define DHCP_ACK 5
|
||||
#define DHCP_NAK 6
|
||||
#define DHCP_RELEASE 7
|
||||
#define DHCP_INFORM 8
|
||||
|
||||
#define DHCP_HTYPE_ETH 1
|
||||
|
||||
#define DHCP_HLEN_ETH 6
|
||||
|
||||
#define DHCP_BROADCAST_FLAG 15
|
||||
#define DHCP_BROADCAST_MASK (1 << DHCP_FLAG_BROADCAST)
|
||||
|
||||
/** BootP options */
|
||||
#define DHCP_OPTION_PAD 0
|
||||
#define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */
|
||||
#define DHCP_OPTION_ROUTER 3
|
||||
#define DHCP_OPTION_DNS_SERVER 6
|
||||
#define DHCP_OPTION_HOSTNAME 12
|
||||
#define DHCP_OPTION_IP_TTL 23
|
||||
#define DHCP_OPTION_MTU 26
|
||||
#define DHCP_OPTION_BROADCAST 28
|
||||
#define DHCP_OPTION_TCP_TTL 37
|
||||
#define DHCP_OPTION_END 255
|
||||
|
||||
/** DHCP options */
|
||||
#define DHCP_OPTION_REQUESTED_IP 50 /* RFC 2132 9.1, requested IP address */
|
||||
#define DHCP_OPTION_LEASE_TIME 51 /* RFC 2132 9.2, time in seconds, in 4 bytes */
|
||||
#define DHCP_OPTION_OVERLOAD 52 /* RFC2132 9.3, use file and/or sname field for options */
|
||||
|
||||
#define DHCP_OPTION_MESSAGE_TYPE 53 /* RFC 2132 9.6, important for DHCP */
|
||||
#define DHCP_OPTION_MESSAGE_TYPE_LEN 1
|
||||
|
||||
|
||||
#define DHCP_OPTION_SERVER_ID 54 /* RFC 2132 9.7, server IP address */
|
||||
#define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 /* RFC 2132 9.8, requested option types */
|
||||
|
||||
#define DHCP_OPTION_MAX_MSG_SIZE 57 /* RFC 2132 9.10, message size accepted >= 576 */
|
||||
#define DHCP_OPTION_MAX_MSG_SIZE_LEN 2
|
||||
|
||||
#define DHCP_OPTION_T1 58 /* T1 renewal time */
|
||||
#define DHCP_OPTION_T2 59 /* T2 rebinding time */
|
||||
#define DHCP_OPTION_CLIENT_ID 61
|
||||
#define DHCP_OPTION_TFTP_SERVERNAME 66
|
||||
#define DHCP_OPTION_BOOTFILE 67
|
||||
|
||||
/** possible combinations of overloading the file and sname fields with options */
|
||||
#define DHCP_OVERLOAD_NONE 0
|
||||
#define DHCP_OVERLOAD_FILE 1
|
||||
#define DHCP_OVERLOAD_SNAME 2
|
||||
#define DHCP_OVERLOAD_SNAME_FILE 3
|
||||
|
||||
#endif /*__LWIP_DHCP_H__*/
|
70
wii/libogc/include/lwip/err.h
Normal file
70
wii/libogc/include/lwip/err.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_ERR_H__
|
||||
#define __LWIP_ERR_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "arch/cc.h"
|
||||
|
||||
typedef s8_t err_t;
|
||||
|
||||
/* Definitions for error constants. */
|
||||
|
||||
#define ERR_OK 0 /* No error, everything OK. */
|
||||
#define ERR_MEM -1 /* Out of memory error. */
|
||||
#define ERR_BUF -2 /* Buffer error. */
|
||||
|
||||
|
||||
#define ERR_ABRT -3 /* Connection aborted. */
|
||||
#define ERR_RST -4 /* Connection reset. */
|
||||
#define ERR_CLSD -5 /* Connection closed. */
|
||||
#define ERR_CONN -6 /* Not connected. */
|
||||
|
||||
#define ERR_VAL -7 /* Illegal value. */
|
||||
|
||||
#define ERR_ARG -8 /* Illegal argument. */
|
||||
|
||||
#define ERR_RTE -9 /* Routing problem. */
|
||||
|
||||
#define ERR_USE -10 /* Address in use. */
|
||||
|
||||
#define ERR_IF -11 /* Low-level netif error */
|
||||
#define ERR_ISCONN -12 /* Already connected. */
|
||||
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
extern char *lwip_strerr(err_t err);
|
||||
#else
|
||||
#define lwip_strerr(x) ""
|
||||
#endif /* LWIP_DEBUG */
|
||||
#endif /* __LWIP_ERR_H__ */
|
220
wii/libogc/include/lwip/lwipopts.h
Normal file
220
wii/libogc/include/lwip/lwipopts.h
Normal file
@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIPOPTS_H__
|
||||
#define __LWIPOPTS_H__
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#undef BYTE_ORDER
|
||||
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#define NO_SYS 1
|
||||
#define LWIP_CALLBACK_API 1
|
||||
#undef LWIP_EVENT_API
|
||||
#define TCPIP_THREAD_PRIO 125
|
||||
#define SYS_LIGHTWEIGHT_PROT 1
|
||||
|
||||
/* ---------- Memory options ---------- */
|
||||
/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
|
||||
lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
|
||||
byte alignment -> define MEM_ALIGNMENT to 2. */
|
||||
#define MEM_ALIGNMENT 4
|
||||
|
||||
/* MEM_SIZE: the size of the heap memory. If the application will send
|
||||
a lot of data that needs to be copied, this should be set high. */
|
||||
#define MEM_SIZE (192*1024)
|
||||
|
||||
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
|
||||
sends a lot of data out of ROM (or other static memory), this
|
||||
should be set high. */
|
||||
#define MEMP_NUM_PBUF 128
|
||||
/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
|
||||
per active UDP "connection". */
|
||||
#define MEMP_NUM_UDP_PCB 16
|
||||
/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
|
||||
connections. */
|
||||
#define MEMP_NUM_TCP_PCB 16
|
||||
/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
|
||||
connections. */
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN 8
|
||||
/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
|
||||
segments. */
|
||||
#define MEMP_NUM_TCP_SEG 128
|
||||
|
||||
/* The following four are used only with the sequential API and can be
|
||||
set to 0 if the application only will use the raw API. */
|
||||
/* MEMP_NUM_NETBUF: the number of struct netbufs. */
|
||||
#define MEMP_NUM_NETBUF 16
|
||||
/* MEMP_NUM_NETCONN: the number of struct netconns. */
|
||||
#define MEMP_NUM_NETCONN 16
|
||||
/* MEMP_NUM_APIMSG: the number of struct api_msg, used for
|
||||
communication between the TCP/IP stack and the sequential
|
||||
programs. */
|
||||
#define MEMP_NUM_API_MSG 128
|
||||
/* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
|
||||
for sequential API communication and incoming packets. Used in
|
||||
src/api/tcpip.c. */
|
||||
#define MEMP_NUM_TCPIP_MSG 128
|
||||
/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
|
||||
timeouts. */
|
||||
#define MEMP_NUM_SYS_TIMEOUT 0
|
||||
|
||||
/* ---------- Pbuf options ---------- */
|
||||
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
|
||||
#define PBUF_POOL_SIZE 128 //128
|
||||
|
||||
/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
|
||||
#define PBUF_POOL_BUFSIZE 1600
|
||||
|
||||
/* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
|
||||
link level header. */
|
||||
#define PBUF_LINK_HLEN 16
|
||||
|
||||
/* ---------- TCP options ---------- */
|
||||
#define LWIP_TCP 1
|
||||
#define TCP_TTL 255
|
||||
|
||||
/* Controls if TCP should queue segments that arrive out of
|
||||
order. Define to 0 if your device is low on memory. */
|
||||
#define TCP_QUEUE_OOSEQ 1
|
||||
|
||||
/* TCP Maximum segment size. */
|
||||
#define TCP_MSS 1460
|
||||
|
||||
/* TCP sender buffer space (bytes). */
|
||||
#define TCP_SND_BUF (36*TCP_MSS)
|
||||
|
||||
/* TCP sender buffer space (pbufs). This must be at least = 2 *
|
||||
TCP_SND_BUF/TCP_MSS for things to work. */
|
||||
#define TCP_SND_QUEUELEN (36*TCP_SND_BUF/TCP_MSS)
|
||||
|
||||
/* TCP receive window. */
|
||||
#define TCP_WND (36*TCP_MSS)
|
||||
|
||||
/* Maximum number of retransmissions of data segments. */
|
||||
#define TCP_MAXRTX 12
|
||||
|
||||
/* Maximum number of retransmissions of SYN segments. */
|
||||
#define TCP_SYNMAXRTX 4
|
||||
|
||||
/* ---------- ARP options ---------- */
|
||||
/**
|
||||
* - If enabled, cache entries are generated for every kind of ARP traffic or
|
||||
* broadcast IP traffic. This enhances behaviour for sending to a dynamic set
|
||||
* of hosts, for example if acting as a gateway.
|
||||
* - If disabled, cache entries are generated only for IP destination addresses
|
||||
* in use by lwIP or applications. This enhances performance if sending to a small,
|
||||
* reasonably static number of hosts. Typically for embedded devices.
|
||||
*/
|
||||
|
||||
/* ---------- IP options ---------- */
|
||||
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
|
||||
IP packets across network interfaces. If you are going to run lwIP
|
||||
on a device with only one network interface, define this to 0. */
|
||||
#define IP_FORWARD 0
|
||||
|
||||
/* If defined to 1, IP options are allowed (but not parsed). If
|
||||
defined to 0, all packets with IP options are dropped. */
|
||||
#define IP_OPTIONS 1
|
||||
|
||||
/* ---------- ICMP options ---------- */
|
||||
#define ICMP_TTL 255
|
||||
|
||||
|
||||
/* ---------- DHCP options ---------- */
|
||||
/* Define LWIP_DHCP to 1 if you want DHCP configuration of
|
||||
interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
|
||||
turning this on does currently not work. */
|
||||
#define LWIP_DHCP 1
|
||||
|
||||
/* 1 if you want to do an ARP check on the offered address
|
||||
(recommended). */
|
||||
#define DHCP_DOES_ARP_CHECK 1
|
||||
|
||||
/* ---------- UDP options ---------- */
|
||||
#define LWIP_UDP 1
|
||||
#define UDP_TTL 255
|
||||
|
||||
#define LWIP_STATS 0
|
||||
/* ---------- Statistics options ---------- */
|
||||
/*#define STATS*/
|
||||
#if LWIP_STATS
|
||||
#define LINK_STATS 0
|
||||
#define IP_STATS 0
|
||||
#define ICMP_STATS 0
|
||||
#define UDP_STATS 0
|
||||
#define TCP_STATS 0
|
||||
#define MEM_STATS 0
|
||||
#define MEMP_STATS 0
|
||||
#define PBUF_STATS 0
|
||||
#define SYS_STATS 0
|
||||
#define RAW_STATS 0
|
||||
#endif
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define DBG_TYPES_ON -1
|
||||
#define DEMO_DEBUG DBG_OFF
|
||||
#define ETHARP_DEBUG DBG_OFF
|
||||
#define NETIF_DEBUG DBG_OFF
|
||||
#define PBUF_DEBUG DBG_OFF
|
||||
#define API_LIB_DEBUG DBG_OFF
|
||||
#define API_MSG_DEBUG DBG_ON
|
||||
#define SOCKETS_DEBUG DBG_OFF
|
||||
#define ICMP_DEBUG DBG_OFF
|
||||
#define INET_DEBUG DBG_OFF
|
||||
#define IP_DEBUG DBG_OFF
|
||||
#define IP_REASS_DEBUG DBG_OFF
|
||||
#define MEM_DEBUG DBG_OFF
|
||||
#define MEMP_DEBUG DBG_OFF
|
||||
#define SYS_DEBUG DBG_OFF
|
||||
#define RAW_DEBUG DBG_OFF
|
||||
#define TCP_DEBUG DBG_OFF
|
||||
#define TCP_INPUT_DEBUG DBG_OFF
|
||||
#define TCP_FR_DEBUG DBG_OFF
|
||||
#define TCP_RTO_DEBUG DBG_OFF
|
||||
#define TCP_REXMIT_DEBUG DBG_OFF
|
||||
#define TCP_CWND_DEBUG DBG_OFF
|
||||
#define TCP_WND_DEBUG DBG_OFF
|
||||
#define TCP_OUTPUT_DEBUG DBG_OFF
|
||||
#define TCP_RST_DEBUG DBG_OFF
|
||||
#define TCP_QLEN_DEBUG DBG_OFF
|
||||
#define UDP_DEBUG DBG_OFF
|
||||
#define TCPIP_DEBUG DBG_OFF
|
||||
#define PPP_DEBUG DBG_OFF
|
||||
#define SLIP_DEBUG DBG_OFF
|
||||
#define DHCP_DEBUG DBG_OFF
|
||||
|
||||
#define DBG_MIN_LEVEL DBG_LEVEL_OFF
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __LWIPOPTS_H__ */
|
61
wii/libogc/include/lwip/mem.h
Normal file
61
wii/libogc/include/lwip/mem.h
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_MEM_H__
|
||||
#define __LWIP_MEM_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#if MEM_SIZE > 64000l
|
||||
typedef u32_t mem_size_t;
|
||||
#else
|
||||
typedef u16_t mem_size_t;
|
||||
#endif /* MEM_SIZE > 64000 */
|
||||
|
||||
|
||||
void mem_init(void);
|
||||
|
||||
void *mem_malloc(mem_size_t size);
|
||||
void mem_free(void *mem);
|
||||
void *mem_realloc(void *mem, mem_size_t size);
|
||||
void *mem_reallocm(void *mem, mem_size_t size);
|
||||
|
||||
#ifndef MEM_ALIGN_SIZE
|
||||
#define MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1))
|
||||
#endif
|
||||
|
||||
#ifndef MEM_ALIGN
|
||||
#define MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1)))
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_MEM_H__ */
|
||||
|
63
wii/libogc/include/lwip/memp.h
Normal file
63
wii/libogc/include/lwip/memp.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LWIP_MEMP_H__
|
||||
#define __LWIP_MEMP_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
typedef enum {
|
||||
MEMP_PBUF,
|
||||
MEMP_RAW_PCB,
|
||||
MEMP_UDP_PCB,
|
||||
MEMP_TCP_PCB,
|
||||
MEMP_TCP_PCB_LISTEN,
|
||||
MEMP_TCP_SEG,
|
||||
|
||||
MEMP_NETBUF,
|
||||
MEMP_NETCONN,
|
||||
MEMP_API_MSG,
|
||||
MEMP_TCPIP_MSG,
|
||||
|
||||
MEMP_SYS_TIMEOUT,
|
||||
|
||||
MEMP_MAX
|
||||
} memp_t;
|
||||
|
||||
void memp_init(void);
|
||||
|
||||
void *memp_malloc(memp_t type);
|
||||
void *memp_realloc(memp_t fromtype, memp_t totype, void *mem);
|
||||
void memp_free(memp_t type, void *mem);
|
||||
|
||||
#endif /* __LWIP_MEMP_H__ */
|
||||
|
150
wii/libogc/include/lwip/netif.h
Normal file
150
wii/libogc/include/lwip/netif.h
Normal file
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_NETIF_H__
|
||||
#define __LWIP_NETIF_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#if LWIP_DHCP
|
||||
# include "lwip/dhcp.h"
|
||||
#endif
|
||||
|
||||
/** must be the maximum of all used hardware address lengths
|
||||
across all types of interfaces in use */
|
||||
#define NETIF_MAX_HWADDR_LEN 6U
|
||||
|
||||
/** TODO: define the use (where, when, whom) of netif flags */
|
||||
|
||||
/** whether the network interface is 'up'. this is
|
||||
* a software flag used to control whether this network
|
||||
* interface is enabled and processes traffic.
|
||||
*/
|
||||
#define NETIF_FLAG_UP 0x1U
|
||||
/** if set, the netif has broadcast capability */
|
||||
#define NETIF_FLAG_BROADCAST 0x2U
|
||||
/** if set, the netif is one end of a point-to-point connection */
|
||||
#define NETIF_FLAG_POINTTOPOINT 0x4U
|
||||
/** if set, the interface is configured using DHCP */
|
||||
#define NETIF_FLAG_DHCP 0x08U
|
||||
/** if set, the interface has an active link
|
||||
* (set by the network interface driver) */
|
||||
#define NETIF_FLAG_LINK_UP 0x10U
|
||||
|
||||
/** Generic data structure used for all lwIP network interfaces.
|
||||
* The following fields should be filled in by the initialization
|
||||
* function for the device driver: hwaddr_len, hwaddr[], mtu, flags */
|
||||
|
||||
struct netif {
|
||||
/** pointer to next in linked list */
|
||||
struct netif *next;
|
||||
|
||||
/** IP address configuration in network byte order */
|
||||
struct ip_addr ip_addr;
|
||||
struct ip_addr netmask;
|
||||
struct ip_addr gw;
|
||||
|
||||
/** This function is called by the network device driver
|
||||
* to pass a packet up the TCP/IP stack. */
|
||||
err_t (* input)(struct pbuf *p, struct netif *inp);
|
||||
/** This function is called by the IP module when it wants
|
||||
* to send a packet on the interface. This function typically
|
||||
* first resolves the hardware address, then sends the packet. */
|
||||
err_t (* output)(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr);
|
||||
/** This function is called by the ARP module when it wants
|
||||
* to send a packet on the interface. This function outputs
|
||||
* the pbuf as-is on the link medium. */
|
||||
err_t (* linkoutput)(struct netif *netif, struct pbuf *p);
|
||||
/** This field can be set by the device driver and could point
|
||||
* to state information for the device. */
|
||||
void *state;
|
||||
#if LWIP_DHCP
|
||||
/** the DHCP client state information for this netif */
|
||||
struct dhcp *dhcp;
|
||||
#endif
|
||||
/** number of bytes used in hwaddr */
|
||||
u8_t hwaddr_len;
|
||||
/** link level hardware address of this interface */
|
||||
u8_t hwaddr[NETIF_MAX_HWADDR_LEN];
|
||||
/** maximum transfer unit (in bytes) */
|
||||
u16_t mtu;
|
||||
/** flags (see NETIF_FLAG_ above) */
|
||||
u8_t flags;
|
||||
/** link type */
|
||||
u8_t link_type;
|
||||
/** descriptive abbreviation */
|
||||
char name[2];
|
||||
/** number of this interface */
|
||||
u8_t num;
|
||||
};
|
||||
|
||||
/** The list of network interfaces. */
|
||||
extern struct netif *netif_list;
|
||||
/** The default network interface. */
|
||||
extern struct netif *netif_default;
|
||||
|
||||
/* netif_init() must be called first. */
|
||||
void netif_init(void);
|
||||
|
||||
struct netif *netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask,
|
||||
struct ip_addr *gw,
|
||||
void *state,
|
||||
err_t (* init)(struct netif *netif),
|
||||
err_t (* input)(struct pbuf *p, struct netif *netif));
|
||||
|
||||
void
|
||||
netif_set_addr(struct netif *netif,struct ip_addr *ipaddr, struct ip_addr *netmask,
|
||||
struct ip_addr *gw);
|
||||
void netif_remove(struct netif * netif);
|
||||
|
||||
/* Returns a network interface given its name. The name is of the form
|
||||
"et0", where the first two letters are the "name" field in the
|
||||
netif structure, and the digit is in the num field in the same
|
||||
structure. */
|
||||
struct netif *netif_find(char *name);
|
||||
|
||||
void netif_set_default(struct netif *netif);
|
||||
|
||||
void netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr);
|
||||
void netif_set_netmask(struct netif *netif, struct ip_addr *netmast);
|
||||
void netif_set_gw(struct netif *netif, struct ip_addr *gw);
|
||||
void netif_set_up(struct netif *netif);
|
||||
void netif_set_down(struct netif *netif);
|
||||
u8_t netif_is_up(struct netif *netif);
|
||||
|
||||
#endif /* __LWIP_NETIF_H__ */
|
669
wii/libogc/include/lwip/opt.h
Normal file
669
wii/libogc/include/lwip/opt.h
Normal file
@ -0,0 +1,669 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_OPT_H__
|
||||
#define __LWIP_OPT_H__
|
||||
|
||||
/* Include user defined options first */
|
||||
#include "lwipopts.h"
|
||||
#include "lwip/debug.h"
|
||||
|
||||
/* Define default values for unconfigured parameters. */
|
||||
|
||||
/* Platform specific locking */
|
||||
|
||||
/*
|
||||
* enable SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
|
||||
* for certain critical regions during buffer allocation, deallocation and memory
|
||||
* allocation and deallocation.
|
||||
*/
|
||||
#ifndef SYS_LIGHTWEIGHT_PROT
|
||||
#define SYS_LIGHTWEIGHT_PROT 0
|
||||
#endif
|
||||
|
||||
#ifndef NO_SYS
|
||||
#define NO_SYS 0
|
||||
#endif
|
||||
/* ---------- Memory options ---------- */
|
||||
/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
|
||||
lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
|
||||
byte alignment -> define MEM_ALIGNMENT to 2. */
|
||||
|
||||
#ifndef MEM_ALIGNMENT
|
||||
#define MEM_ALIGNMENT 1
|
||||
#endif
|
||||
|
||||
/* MEM_SIZE: the size of the heap memory. If the application will send
|
||||
a lot of data that needs to be copied, this should be set high. */
|
||||
#ifndef MEM_SIZE
|
||||
#define MEM_SIZE 1600
|
||||
#endif
|
||||
|
||||
#ifndef MEMP_SANITY_CHECK
|
||||
#define MEMP_SANITY_CHECK 0
|
||||
#endif
|
||||
|
||||
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
|
||||
sends a lot of data out of ROM (or other static memory), this
|
||||
should be set high. */
|
||||
#ifndef MEMP_NUM_PBUF
|
||||
#define MEMP_NUM_PBUF 16
|
||||
#endif
|
||||
|
||||
/* Number of raw connection PCBs */
|
||||
#ifndef MEMP_NUM_RAW_PCB
|
||||
#define MEMP_NUM_RAW_PCB 4
|
||||
#endif
|
||||
|
||||
/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
|
||||
per active UDP "connection". */
|
||||
#ifndef MEMP_NUM_UDP_PCB
|
||||
#define MEMP_NUM_UDP_PCB 4
|
||||
#endif
|
||||
/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
|
||||
connections. */
|
||||
#ifndef MEMP_NUM_TCP_PCB
|
||||
#define MEMP_NUM_TCP_PCB 5
|
||||
#endif
|
||||
/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
|
||||
connections. */
|
||||
#ifndef MEMP_NUM_TCP_PCB_LISTEN
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN 8
|
||||
#endif
|
||||
/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
|
||||
segments. */
|
||||
#ifndef MEMP_NUM_TCP_SEG
|
||||
#define MEMP_NUM_TCP_SEG 16
|
||||
#endif
|
||||
/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
|
||||
timeouts. */
|
||||
#ifndef MEMP_NUM_SYS_TIMEOUT
|
||||
#define MEMP_NUM_SYS_TIMEOUT 3
|
||||
#endif
|
||||
|
||||
/* The following four are used only with the sequential API and can be
|
||||
set to 0 if the application only will use the raw API. */
|
||||
/* MEMP_NUM_NETBUF: the number of struct netbufs. */
|
||||
#ifndef MEMP_NUM_NETBUF
|
||||
#define MEMP_NUM_NETBUF 2
|
||||
#endif
|
||||
/* MEMP_NUM_NETCONN: the number of struct netconns. */
|
||||
#ifndef MEMP_NUM_NETCONN
|
||||
#define MEMP_NUM_NETCONN 4
|
||||
#endif
|
||||
/* MEMP_NUM_APIMSG: the number of struct api_msg, used for
|
||||
communication between the TCP/IP stack and the sequential
|
||||
programs. */
|
||||
#ifndef MEMP_NUM_API_MSG
|
||||
#define MEMP_NUM_API_MSG 8
|
||||
#endif
|
||||
/* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
|
||||
for sequential API communication and incoming packets. Used in
|
||||
src/api/tcpip.c. */
|
||||
#ifndef MEMP_NUM_TCPIP_MSG
|
||||
#define MEMP_NUM_TCPIP_MSG 8
|
||||
#endif
|
||||
|
||||
/* ---------- Pbuf options ---------- */
|
||||
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
|
||||
|
||||
#ifndef PBUF_POOL_SIZE
|
||||
#define PBUF_POOL_SIZE 16
|
||||
#endif
|
||||
|
||||
/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
|
||||
|
||||
#ifndef PBUF_POOL_BUFSIZE
|
||||
#define PBUF_POOL_BUFSIZE 128
|
||||
#endif
|
||||
|
||||
/* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
|
||||
link level header. Defaults to 14 for Ethernet. */
|
||||
|
||||
#ifndef PBUF_LINK_HLEN
|
||||
#define PBUF_LINK_HLEN 14
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* ---------- ARP options ---------- */
|
||||
|
||||
/** Number of active hardware address, IP address pairs cached */
|
||||
#ifndef ARP_TABLE_SIZE
|
||||
#define ARP_TABLE_SIZE 10
|
||||
#endif
|
||||
|
||||
/**
|
||||
* If enabled, outgoing packets are queued during hardware address
|
||||
* resolution.
|
||||
*
|
||||
* This feature has not stabilized yet. Single-packet queueing is
|
||||
* believed to be stable, multi-packet queueing is believed to
|
||||
* clash with the TCP segment queueing.
|
||||
*
|
||||
* As multi-packet-queueing is currently disabled, enabling this
|
||||
* _should_ work, but we need your testing feedback on lwip-users.
|
||||
*
|
||||
*/
|
||||
#ifndef ARP_QUEUEING
|
||||
#define ARP_QUEUEING 1
|
||||
#endif
|
||||
|
||||
/* This option is deprecated */
|
||||
#ifdef ETHARP_QUEUE_FIRST
|
||||
#error ETHARP_QUEUE_FIRST option is deprecated. Remove it from your lwipopts.h.
|
||||
#endif
|
||||
|
||||
/* This option is removed to comply with the ARP standard */
|
||||
#ifdef ETHARP_ALWAYS_INSERT
|
||||
#error ETHARP_ALWAYS_INSERT option is deprecated. Remove it from your lwipopts.h.
|
||||
#endif
|
||||
|
||||
/* ---------- IP options ---------- */
|
||||
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
|
||||
IP packets across network interfaces. If you are going to run lwIP
|
||||
on a device with only one network interface, define this to 0. */
|
||||
#ifndef IP_FORWARD
|
||||
#define IP_FORWARD 0
|
||||
#endif
|
||||
|
||||
/* If defined to 1, IP options are allowed (but not parsed). If
|
||||
defined to 0, all packets with IP options are dropped. */
|
||||
#ifndef IP_OPTIONS
|
||||
#define IP_OPTIONS 1
|
||||
#endif
|
||||
|
||||
/** IP reassembly and segmentation. Even if they both deal with IP
|
||||
* fragments, note that these are orthogonal, one dealing with incoming
|
||||
* packets, the other with outgoing packets
|
||||
*/
|
||||
|
||||
/** Reassemble incoming fragmented IP packets */
|
||||
#ifndef IP_REASSEMBLY
|
||||
#define IP_REASSEMBLY 1
|
||||
#endif
|
||||
|
||||
/** Fragment outgoing IP packets if their size exceeds MTU */
|
||||
#ifndef IP_FRAG
|
||||
#define IP_FRAG 1
|
||||
#endif
|
||||
|
||||
/* ---------- ICMP options ---------- */
|
||||
|
||||
#ifndef ICMP_TTL
|
||||
#define ICMP_TTL 255
|
||||
#endif
|
||||
|
||||
/* ---------- RAW options ---------- */
|
||||
|
||||
#ifndef LWIP_RAW
|
||||
#define LWIP_RAW 1
|
||||
#endif
|
||||
|
||||
#ifndef RAW_TTL
|
||||
#define RAW_TTL 255
|
||||
#endif
|
||||
|
||||
/* ---------- DHCP options ---------- */
|
||||
|
||||
#ifndef LWIP_DHCP
|
||||
#define LWIP_DHCP 0
|
||||
#endif
|
||||
|
||||
/* 1 if you want to do an ARP check on the offered address
|
||||
(recommended). */
|
||||
#ifndef DHCP_DOES_ARP_CHECK
|
||||
#define DHCP_DOES_ARP_CHECK 1
|
||||
#endif
|
||||
|
||||
/* ---------- UDP options ---------- */
|
||||
#ifndef LWIP_UDP
|
||||
#define LWIP_UDP 1
|
||||
#endif
|
||||
|
||||
#ifndef UDP_TTL
|
||||
#define UDP_TTL 255
|
||||
#endif
|
||||
|
||||
/* ---------- TCP options ---------- */
|
||||
#ifndef LWIP_TCP
|
||||
#define LWIP_TCP 1
|
||||
#endif
|
||||
|
||||
#ifndef TCP_TTL
|
||||
#define TCP_TTL 255
|
||||
#endif
|
||||
|
||||
#ifndef TCP_WND
|
||||
#define TCP_WND 2048
|
||||
#endif
|
||||
|
||||
#ifndef TCP_MAXRTX
|
||||
#define TCP_MAXRTX 12
|
||||
#endif
|
||||
|
||||
#ifndef TCP_SYNMAXRTX
|
||||
#define TCP_SYNMAXRTX 6
|
||||
#endif
|
||||
|
||||
|
||||
/* Controls if TCP should queue segments that arrive out of
|
||||
order. Define to 0 if your device is low on memory. */
|
||||
#ifndef TCP_QUEUE_OOSEQ
|
||||
#define TCP_QUEUE_OOSEQ 1
|
||||
#endif
|
||||
|
||||
/* TCP Maximum segment size. */
|
||||
#ifndef TCP_MSS
|
||||
#define TCP_MSS 128 /* A *very* conservative default. */
|
||||
#endif
|
||||
|
||||
/* TCP sender buffer space (bytes). */
|
||||
#ifndef TCP_SND_BUF
|
||||
#define TCP_SND_BUF 256
|
||||
#endif
|
||||
|
||||
/* TCP sender buffer space (pbufs). This must be at least = 2 *
|
||||
TCP_SND_BUF/TCP_MSS for things to work. */
|
||||
#ifndef TCP_SND_QUEUELEN
|
||||
#define TCP_SND_QUEUELEN 4 * TCP_SND_BUF/TCP_MSS
|
||||
#endif
|
||||
|
||||
|
||||
/* Maximum number of retransmissions of data segments. */
|
||||
|
||||
/* Maximum number of retransmissions of SYN segments. */
|
||||
|
||||
/* TCP writable space (bytes). This must be less than or equal
|
||||
to TCP_SND_BUF. It is the amount of space which must be
|
||||
available in the tcp snd_buf for select to return writable */
|
||||
#ifndef TCP_SNDLOWAT
|
||||
#define TCP_SNDLOWAT TCP_SND_BUF/2
|
||||
#endif
|
||||
|
||||
/* Support loop interface (127.0.0.1) */
|
||||
#ifndef LWIP_HAVE_LOOPIF
|
||||
#define LWIP_HAVE_LOOPIF 1
|
||||
#endif
|
||||
|
||||
#ifndef LWIP_EVENT_API
|
||||
#define LWIP_EVENT_API 0
|
||||
#define LWIP_CALLBACK_API 1
|
||||
#else
|
||||
#define LWIP_EVENT_API 1
|
||||
#define LWIP_CALLBACK_API 0
|
||||
#endif
|
||||
|
||||
#ifndef LWIP_COMPAT_SOCKETS
|
||||
#define LWIP_COMPAT_SOCKETS 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef TCPIP_THREAD_PRIO
|
||||
#define TCPIP_THREAD_PRIO 1
|
||||
#endif
|
||||
|
||||
#ifndef SLIPIF_THREAD_PRIO
|
||||
#define SLIPIF_THREAD_PRIO 1
|
||||
#endif
|
||||
|
||||
#ifndef PPP_THREAD_PRIO
|
||||
#define PPP_THREAD_PRIO 1
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_THREAD_PRIO
|
||||
#define DEFAULT_THREAD_PRIO 1
|
||||
#endif
|
||||
|
||||
|
||||
/* ---------- Socket Options ---------- */
|
||||
/* Enable SO_REUSEADDR and SO_REUSEPORT options */
|
||||
#ifndef SO_REUSE
|
||||
# define SO_REUSE 0
|
||||
#endif
|
||||
|
||||
|
||||
/* ---------- Statistics options ---------- */
|
||||
#ifndef LWIP_STATS
|
||||
#define LWIP_STATS 1
|
||||
#endif
|
||||
|
||||
#if LWIP_STATS
|
||||
|
||||
#ifndef LWIP_STATS_DISPLAY
|
||||
#define LWIP_STATS_DISPLAY 0
|
||||
#endif
|
||||
|
||||
#ifndef LINK_STATS
|
||||
#define LINK_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef IP_STATS
|
||||
#define IP_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef IPFRAG_STATS
|
||||
#define IPFRAG_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef ICMP_STATS
|
||||
#define ICMP_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef UDP_STATS
|
||||
#define UDP_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef TCP_STATS
|
||||
#define TCP_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef MEM_STATS
|
||||
#define MEM_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef MEMP_STATS
|
||||
#define MEMP_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef PBUF_STATS
|
||||
#define PBUF_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef SYS_STATS
|
||||
#define SYS_STATS 1
|
||||
#endif
|
||||
|
||||
#ifndef RAW_STATS
|
||||
#define RAW_STATS 0
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define LINK_STATS 0
|
||||
#define IP_STATS 0
|
||||
#define IPFRAG_STATS 0
|
||||
#define ICMP_STATS 0
|
||||
#define UDP_STATS 0
|
||||
#define TCP_STATS 0
|
||||
#define MEM_STATS 0
|
||||
#define MEMP_STATS 0
|
||||
#define PBUF_STATS 0
|
||||
#define SYS_STATS 0
|
||||
#define RAW_STATS 0
|
||||
#define LWIP_STATS_DISPLAY 0
|
||||
|
||||
#endif /* LWIP_STATS */
|
||||
|
||||
/* ---------- PPP options ---------- */
|
||||
|
||||
#ifndef PPP_SUPPORT
|
||||
#define PPP_SUPPORT 0 /* Set for PPP */
|
||||
#endif
|
||||
|
||||
#if PPP_SUPPORT
|
||||
|
||||
#define NUM_PPP 1 /* Max PPP sessions. */
|
||||
|
||||
|
||||
|
||||
#ifndef PAP_SUPPORT
|
||||
#define PAP_SUPPORT 0 /* Set for PAP. */
|
||||
#endif
|
||||
|
||||
#ifndef CHAP_SUPPORT
|
||||
#define CHAP_SUPPORT 0 /* Set for CHAP. */
|
||||
#endif
|
||||
|
||||
#define MSCHAP_SUPPORT 0 /* Set for MSCHAP (NOT FUNCTIONAL!) */
|
||||
#define CBCP_SUPPORT 0 /* Set for CBCP (NOT FUNCTIONAL!) */
|
||||
#define CCP_SUPPORT 0 /* Set for CCP (NOT FUNCTIONAL!) */
|
||||
|
||||
#ifndef VJ_SUPPORT
|
||||
#define VJ_SUPPORT 0 /* Set for VJ header compression. */
|
||||
#endif
|
||||
|
||||
#ifndef MD5_SUPPORT
|
||||
#define MD5_SUPPORT 0 /* Set for MD5 (see also CHAP) */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Timeouts.
|
||||
*/
|
||||
#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */
|
||||
#define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */
|
||||
#define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */
|
||||
#define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */
|
||||
|
||||
#define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */
|
||||
#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */
|
||||
|
||||
#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */
|
||||
#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */
|
||||
|
||||
|
||||
/* Interval in seconds between keepalive echo requests, 0 to disable. */
|
||||
#if 1
|
||||
#define LCP_ECHOINTERVAL 0
|
||||
#else
|
||||
#define LCP_ECHOINTERVAL 10
|
||||
#endif
|
||||
|
||||
/* Number of unanswered echo requests before failure. */
|
||||
#define LCP_MAXECHOFAILS 3
|
||||
|
||||
/* Max Xmit idle time (in jiffies) before resend flag char. */
|
||||
#define PPP_MAXIDLEFLAG 100
|
||||
|
||||
/*
|
||||
* Packet sizes
|
||||
*
|
||||
* Note - lcp shouldn't be allowed to negotiate stuff outside these
|
||||
* limits. See lcp.h in the pppd directory.
|
||||
* (XXX - these constants should simply be shared by lcp.c instead
|
||||
* of living in lcp.h)
|
||||
*/
|
||||
#define PPP_MTU 1500 /* Default MTU (size of Info field) */
|
||||
#if 0
|
||||
#define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN)
|
||||
#else
|
||||
#define PPP_MAXMTU 1500 /* Largest MTU we allow */
|
||||
#endif
|
||||
#define PPP_MINMTU 64
|
||||
#define PPP_MRU 1500 /* default MRU = max length of info field */
|
||||
#define PPP_MAXMRU 1500 /* Largest MRU we allow */
|
||||
#define PPP_DEFMRU 296 /* Try for this */
|
||||
#define PPP_MINMRU 128 /* No MRUs below this */
|
||||
|
||||
|
||||
#define MAXNAMELEN 256 /* max length of hostname or name for auth */
|
||||
#define MAXSECRETLEN 256 /* max length of password or secret */
|
||||
|
||||
#endif /* PPP_SUPPORT */
|
||||
|
||||
/* checksum options - set to zero for hardware checksum support */
|
||||
|
||||
#ifndef CHECKSUM_GEN_IP
|
||||
#define CHECKSUM_GEN_IP 1
|
||||
#endif
|
||||
|
||||
#ifndef CHECKSUM_GEN_UDP
|
||||
#define CHECKSUM_GEN_UDP 1
|
||||
#endif
|
||||
|
||||
#ifndef CHECKSUM_GEN_TCP
|
||||
#define CHECKSUM_GEN_TCP 1
|
||||
#endif
|
||||
|
||||
#ifndef CHECKSUM_CHECK_IP
|
||||
#define CHECKSUM_CHECK_IP 1
|
||||
#endif
|
||||
|
||||
#ifndef CHECKSUM_CHECK_UDP
|
||||
#define CHECKSUM_CHECK_UDP 1
|
||||
#endif
|
||||
|
||||
#ifndef CHECKSUM_CHECK_TCP
|
||||
#define CHECKSUM_CHECK_TCP 1
|
||||
#endif
|
||||
|
||||
/* Debugging options all default to off */
|
||||
|
||||
#ifndef DBG_TYPES_ON
|
||||
#define DBG_TYPES_ON 0
|
||||
#endif
|
||||
|
||||
#ifndef ETHARP_DEBUG
|
||||
#define ETHARP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef NETIF_DEBUG
|
||||
#define NETIF_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef PBUF_DEBUG
|
||||
#define PBUF_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef API_LIB_DEBUG
|
||||
#define API_LIB_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef API_MSG_DEBUG
|
||||
#define API_MSG_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef SOCKETS_DEBUG
|
||||
#define SOCKETS_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef ICMP_DEBUG
|
||||
#define ICMP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef INET_DEBUG
|
||||
#define INET_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef IP_DEBUG
|
||||
#define IP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef IP_REASS_DEBUG
|
||||
#define IP_REASS_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef RAW_DEBUG
|
||||
#define RAW_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef MEM_DEBUG
|
||||
#define MEM_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef MEMP_DEBUG
|
||||
#define MEMP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef SYS_DEBUG
|
||||
#define SYS_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_DEBUG
|
||||
#define TCP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_INPUT_DEBUG
|
||||
#define TCP_INPUT_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_FR_DEBUG
|
||||
#define TCP_FR_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_RTO_DEBUG
|
||||
#define TCP_RTO_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_REXMIT_DEBUG
|
||||
#define TCP_REXMIT_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_CWND_DEBUG
|
||||
#define TCP_CWND_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_WND_DEBUG
|
||||
#define TCP_WND_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_OUTPUT_DEBUG
|
||||
#define TCP_OUTPUT_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_RST_DEBUG
|
||||
#define TCP_RST_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCP_QLEN_DEBUG
|
||||
#define TCP_QLEN_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef UDP_DEBUG
|
||||
#define UDP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef TCPIP_DEBUG
|
||||
#define TCPIP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef PPP_DEBUG
|
||||
#define PPP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef SLIP_DEBUG
|
||||
#define SLIP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
#ifndef DHCP_DEBUG
|
||||
#define DHCP_DEBUG DBG_OFF
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef DBG_MIN_LEVEL
|
||||
#define DBG_MIN_LEVEL DBG_LEVEL_OFF
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_OPT_H__ */
|
||||
|
||||
|
||||
|
113
wii/libogc/include/lwip/pbuf.h
Normal file
113
wii/libogc/include/lwip/pbuf.h
Normal file
@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LWIP_PBUF_H__
|
||||
#define __LWIP_PBUF_H__
|
||||
|
||||
#include "arch/cc.h"
|
||||
|
||||
|
||||
#define PBUF_TRANSPORT_HLEN 20
|
||||
#define PBUF_IP_HLEN 20
|
||||
|
||||
typedef enum {
|
||||
PBUF_TRANSPORT,
|
||||
PBUF_IP,
|
||||
PBUF_LINK,
|
||||
PBUF_RAW
|
||||
} pbuf_layer;
|
||||
|
||||
typedef enum {
|
||||
PBUF_RAM,
|
||||
PBUF_ROM,
|
||||
PBUF_REF,
|
||||
PBUF_POOL
|
||||
} pbuf_flag;
|
||||
|
||||
/* Definitions for the pbuf flag field. These are NOT the flags that
|
||||
* are passed to pbuf_alloc(). */
|
||||
#define PBUF_FLAG_RAM 0x00U /* Flags that pbuf data is stored in RAM */
|
||||
#define PBUF_FLAG_ROM 0x01U /* Flags that pbuf data is stored in ROM */
|
||||
#define PBUF_FLAG_POOL 0x02U /* Flags that the pbuf comes from the pbuf pool */
|
||||
#define PBUF_FLAG_REF 0x04U /* Flags thet the pbuf payload refers to RAM */
|
||||
|
||||
/** indicates this packet was broadcast on the link */
|
||||
#define PBUF_FLAG_LINK_BROADCAST 0x80U
|
||||
|
||||
struct pbuf {
|
||||
/** next pbuf in singly linked pbuf chain */
|
||||
struct pbuf *next;
|
||||
|
||||
/** pointer to the actual data in the buffer */
|
||||
void *payload;
|
||||
|
||||
/**
|
||||
* total length of this buffer and all next buffers in chain
|
||||
* belonging to the same packet.
|
||||
*
|
||||
* For non-queue packet chains this is the invariant:
|
||||
* p->tot_len == p->len + (p->next? p->next->tot_len: 0)
|
||||
*/
|
||||
u16_t tot_len;
|
||||
|
||||
/** length of this buffer */
|
||||
u16_t len;
|
||||
|
||||
/** flags telling the type of pbuf, see PBUF_FLAG_ */
|
||||
u16_t flags;
|
||||
|
||||
/**
|
||||
* the reference count always equals the number of pointers
|
||||
* that refer to this pbuf. This can be pointers from an application,
|
||||
* the stack itself, or pbuf->next pointers from a chain.
|
||||
*/
|
||||
u16_t ref;
|
||||
|
||||
};
|
||||
|
||||
void pbuf_init(void);
|
||||
|
||||
struct pbuf *pbuf_alloc(pbuf_layer l, u16_t size, pbuf_flag flag);
|
||||
void pbuf_realloc(struct pbuf *p, u16_t size);
|
||||
u8_t pbuf_header(struct pbuf *p, s16_t header_size);
|
||||
void pbuf_ref(struct pbuf *p);
|
||||
void pbuf_ref_chain(struct pbuf *p);
|
||||
u8_t pbuf_free(struct pbuf *p);
|
||||
u8_t pbuf_clen(struct pbuf *p);
|
||||
void pbuf_cat(struct pbuf *h, struct pbuf *t);
|
||||
void pbuf_chain(struct pbuf *h, struct pbuf *t);
|
||||
struct pbuf *pbuf_take(struct pbuf *f);
|
||||
struct pbuf *pbuf_dechain(struct pbuf *p);
|
||||
void pbuf_queue(struct pbuf *p, struct pbuf *n);
|
||||
struct pbuf * pbuf_dequeue(struct pbuf *p);
|
||||
|
||||
#endif /* __LWIP_PBUF_H__ */
|
74
wii/libogc/include/lwip/raw.h
Normal file
74
wii/libogc/include/lwip/raw.h
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_RAW_H__
|
||||
#define __LWIP_RAW_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/ip.h"
|
||||
|
||||
struct raw_pcb {
|
||||
/* Common members of all PCB types */
|
||||
IP_PCB;
|
||||
|
||||
struct raw_pcb *next;
|
||||
|
||||
u16_t protocol;
|
||||
|
||||
u8_t (* recv)(void *arg, struct raw_pcb *pcb, struct pbuf *p,
|
||||
struct ip_addr *addr);
|
||||
void *recv_arg;
|
||||
};
|
||||
|
||||
/* The following functions is the application layer interface to the
|
||||
RAW code. */
|
||||
struct raw_pcb * raw_new (u16_t proto);
|
||||
void raw_remove (struct raw_pcb *pcb);
|
||||
err_t raw_bind (struct raw_pcb *pcb, struct ip_addr *ipaddr);
|
||||
err_t raw_connect (struct raw_pcb *pcb, struct ip_addr *ipaddr);
|
||||
|
||||
void raw_recv (struct raw_pcb *pcb,
|
||||
u8_t (* recv)(void *arg, struct raw_pcb *pcb,
|
||||
struct pbuf *p,
|
||||
struct ip_addr *addr),
|
||||
void *recv_arg);
|
||||
err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, struct ip_addr *ipaddr);
|
||||
err_t raw_send (struct raw_pcb *pcb, struct pbuf *p);
|
||||
|
||||
/* The following functions are the lower layer interface to RAW. */
|
||||
u8_t raw_input (struct pbuf *p, struct netif *inp);
|
||||
void raw_init (void);
|
||||
|
||||
|
||||
#endif /* __LWIP_RAW_H__ */
|
63
wii/libogc/include/lwip/sio.h
Normal file
63
wii/libogc/include/lwip/sio.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is the interface to the platform specific serial IO module
|
||||
* It needs to be implemented by those platforms which need SLIP or PPP
|
||||
*/
|
||||
|
||||
#include "arch/cc.h"
|
||||
|
||||
#ifndef __sio_fd_t_defined
|
||||
typedef void * sio_fd_t;
|
||||
#endif
|
||||
|
||||
#ifndef sio_open
|
||||
sio_fd_t sio_open(u8_t);
|
||||
#endif
|
||||
|
||||
#ifndef sio_send
|
||||
void sio_send(u8_t, sio_fd_t);
|
||||
#endif
|
||||
|
||||
#ifndef sio_recv
|
||||
u8_t sio_recv(sio_fd_t);
|
||||
#endif
|
||||
|
||||
#ifndef sio_read
|
||||
u32_t sio_read(sio_fd_t, u8_t *, u32_t);
|
||||
#endif
|
||||
|
||||
#ifndef sio_write
|
||||
u32_t sio_write(sio_fd_t, u8_t *, u32_t);
|
||||
#endif
|
||||
|
||||
#ifndef sio_read_abort
|
||||
void sio_read_abort(sio_fd_t);
|
||||
#endif
|
178
wii/libogc/include/lwip/snmp.h
Normal file
178
wii/libogc/include/lwip/snmp.h
Normal file
@ -0,0 +1,178 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2002 Leon Woestenberg <leon.woestenberg@axon.tv>
|
||||
* Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Leon Woestenberg <leon.woestenberg@axon.tv>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_SNMP_H__
|
||||
#define __LWIP_SNMP_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
/* SNMP support available? */
|
||||
#if defined(LWIP_SNMP) && (LWIP_SNMP > 0)
|
||||
|
||||
/* network interface */
|
||||
void snmp_add_ifinoctets(unsigned long value);
|
||||
void snmp_inc_ifinucastpkts(void);
|
||||
void snmp_inc_ifinnucastpkts(void);
|
||||
void snmp_inc_ifindiscards(void);
|
||||
void snmp_add_ifoutoctets(unsigned long value);
|
||||
void snmp_inc_ifoutucastpkts(void);
|
||||
void snmp_inc_ifoutnucastpkts(void);
|
||||
void snmp_inc_ifoutdiscards(void);
|
||||
|
||||
/* IP */
|
||||
void snmp_inc_ipinreceives(void);
|
||||
void snmp_inc_ipindelivers(void);
|
||||
void snmp_inc_ipindiscards(void);
|
||||
void snmp_inc_ipoutdiscards(void);
|
||||
void snmp_inc_ipoutrequests(void);
|
||||
void snmp_inc_ipunknownprotos(void);
|
||||
void snmp_inc_ipnoroutes(void);
|
||||
void snmp_inc_ipforwdatagrams(void);
|
||||
|
||||
/* ICMP */
|
||||
void snmp_inc_icmpinmsgs(void);
|
||||
void snmp_inc_icmpinerrors(void);
|
||||
void snmp_inc_icmpindestunreachs(void);
|
||||
void snmp_inc_icmpintimeexcds(void);
|
||||
void snmp_inc_icmpinparmprobs(void);
|
||||
void snmp_inc_icmpinsrcquenchs(void);
|
||||
void snmp_inc_icmpinredirects(void);
|
||||
void snmp_inc_icmpinechos(void);
|
||||
void snmp_inc_icmpinechoreps(void);
|
||||
void snmp_inc_icmpintimestamps(void);
|
||||
void snmp_inc_icmpintimestampreps(void);
|
||||
void snmp_inc_icmpinaddrmasks(void);
|
||||
void snmp_inc_icmpinaddrmaskreps(void);
|
||||
void snmp_inc_icmpoutmsgs(void);
|
||||
void snmp_inc_icmpouterrors(void);
|
||||
void snmp_inc_icmpoutdestunreachs(void);
|
||||
void snmp_inc_icmpouttimeexcds(void);
|
||||
void snmp_inc_icmpoutparmprobs(void);
|
||||
void snmp_inc_icmpoutsrcquenchs(void);
|
||||
void snmp_inc_icmpoutredirects(void);
|
||||
void snmp_inc_icmpoutechos(void);
|
||||
void snmp_inc_icmpoutechoreps(void);
|
||||
void snmp_inc_icmpouttimestamps(void);
|
||||
void snmp_inc_icmpouttimestampreps(void);
|
||||
void snmp_inc_icmpoutaddrmasks(void);
|
||||
void snmp_inc_icmpoutaddrmaskreps(void);
|
||||
|
||||
/* TCP */
|
||||
void snmp_inc_tcpactiveopens(void);
|
||||
void snmp_inc_tcppassiveopens(void);
|
||||
void snmp_inc_tcpattemptfails(void);
|
||||
void snmp_inc_tcpestabresets(void);
|
||||
void snmp_inc_tcpcurrestab(void);
|
||||
void snmp_inc_tcpinsegs(void);
|
||||
void snmp_inc_tcpoutsegs(void);
|
||||
void snmp_inc_tcpretranssegs(void);
|
||||
void snmp_inc_tcpinerrs(void);
|
||||
void snmp_inc_tcpoutrsts(void);
|
||||
|
||||
/* UDP */
|
||||
void snmp_inc_udpindatagrams(void);
|
||||
void snmp_inc_udpnoports(void);
|
||||
void snmp_inc_udpinerrors(void);
|
||||
void snmp_inc_udpoutdatagrams(void);
|
||||
|
||||
/* LWIP_SNMP support not available */
|
||||
/* define everything to be empty */
|
||||
#else
|
||||
|
||||
/* network interface */
|
||||
#define snmp_add_ifinoctets(value)
|
||||
#define snmp_inc_ifinucastpkts()
|
||||
#define snmp_inc_ifinnucastpkts()
|
||||
#define snmp_inc_ifindiscards()
|
||||
#define snmp_add_ifoutoctets(value)
|
||||
#define snmp_inc_ifoutucastpkts()
|
||||
#define snmp_inc_ifoutnucastpkts()
|
||||
#define snmp_inc_ifoutdiscards()
|
||||
|
||||
/* IP */
|
||||
#define snmp_inc_ipinreceives()
|
||||
#define snmp_inc_ipindelivers()
|
||||
#define snmp_inc_ipindiscards()
|
||||
#define snmp_inc_ipoutdiscards()
|
||||
#define snmp_inc_ipoutrequests()
|
||||
#define snmp_inc_ipunknownprotos()
|
||||
#define snmp_inc_ipnoroutes()
|
||||
#define snmp_inc_ipforwdatagrams()
|
||||
|
||||
/* ICMP */
|
||||
#define snmp_inc_icmpinmsgs()
|
||||
#define snmp_inc_icmpinerrors()
|
||||
#define snmp_inc_icmpindestunreachs()
|
||||
#define snmp_inc_icmpintimeexcds()
|
||||
#define snmp_inc_icmpinparmprobs()
|
||||
#define snmp_inc_icmpinsrcquenchs()
|
||||
#define snmp_inc_icmpinredirects()
|
||||
#define snmp_inc_icmpinechos()
|
||||
#define snmp_inc_icmpinechoreps()
|
||||
#define snmp_inc_icmpintimestamps()
|
||||
#define snmp_inc_icmpintimestampreps()
|
||||
#define snmp_inc_icmpinaddrmasks()
|
||||
#define snmp_inc_icmpinaddrmaskreps()
|
||||
#define snmp_inc_icmpoutmsgs()
|
||||
#define snmp_inc_icmpouterrors()
|
||||
#define snmp_inc_icmpoutdestunreachs()
|
||||
#define snmp_inc_icmpouttimeexcds()
|
||||
#define snmp_inc_icmpoutparmprobs()
|
||||
#define snmp_inc_icmpoutsrcquenchs()
|
||||
#define snmp_inc_icmpoutredirects()
|
||||
#define snmp_inc_icmpoutechos()
|
||||
#define snmp_inc_icmpoutechoreps()
|
||||
#define snmp_inc_icmpouttimestamps()
|
||||
#define snmp_inc_icmpouttimestampreps()
|
||||
#define snmp_inc_icmpoutaddrmasks()
|
||||
#define snmp_inc_icmpoutaddrmaskreps()
|
||||
/* TCP */
|
||||
#define snmp_inc_tcpactiveopens()
|
||||
#define snmp_inc_tcppassiveopens()
|
||||
#define snmp_inc_tcpattemptfails()
|
||||
#define snmp_inc_tcpestabresets()
|
||||
#define snmp_inc_tcpcurrestab()
|
||||
#define snmp_inc_tcpinsegs()
|
||||
#define snmp_inc_tcpoutsegs()
|
||||
#define snmp_inc_tcpretranssegs()
|
||||
#define snmp_inc_tcpinerrs()
|
||||
#define snmp_inc_tcpoutrsts()
|
||||
|
||||
/* UDP */
|
||||
#define snmp_inc_udpindatagrams()
|
||||
#define snmp_inc_udpnoports()
|
||||
#define snmp_inc_udpinerrors()
|
||||
#define snmp_inc_udpoutdatagrams()
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_SNMP_H__ */
|
271
wii/libogc/include/lwip/sockets.h
Normal file
271
wii/libogc/include/lwip/sockets.h
Normal file
@ -0,0 +1,271 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __LWIP_SOCKETS_H__
|
||||
#define __LWIP_SOCKETS_H__
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
struct sockaddr_in {
|
||||
u8_t sin_len;
|
||||
u8_t sin_family;
|
||||
u16_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
char sin_zero[8];
|
||||
};
|
||||
|
||||
struct sockaddr {
|
||||
u8_t sa_len;
|
||||
u8_t sa_family;
|
||||
char sa_data[14];
|
||||
};
|
||||
|
||||
#ifndef socklen_t
|
||||
# define socklen_t int
|
||||
#endif
|
||||
|
||||
|
||||
#define SOCK_STREAM 1
|
||||
#define SOCK_DGRAM 2
|
||||
#define SOCK_RAW 3
|
||||
|
||||
/*
|
||||
* Option flags per-socket.
|
||||
*/
|
||||
#define SO_DEBUG 0x0001 /* turn on debugging info recording */
|
||||
#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
|
||||
#define SO_REUSEADDR 0x0004 /* allow local address reuse */
|
||||
#define SO_KEEPALIVE 0x0008 /* keep connections alive */
|
||||
#define SO_DONTROUTE 0x0010 /* just use interface addresses */
|
||||
#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
|
||||
#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
|
||||
#define SO_LINGER 0x0080 /* linger on close if data present */
|
||||
#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
|
||||
#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
|
||||
|
||||
#define SO_DONTLINGER (int)(~SO_LINGER)
|
||||
|
||||
/*
|
||||
* Additional options, not kept in so_options.
|
||||
*/
|
||||
#define SO_SNDBUF 0x1001 /* send buffer size */
|
||||
#define SO_RCVBUF 0x1002 /* receive buffer size */
|
||||
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
|
||||
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
|
||||
#define SO_SNDTIMEO 0x1005 /* send timeout */
|
||||
#define SO_RCVTIMEO 0x1006 /* receive timeout */
|
||||
#define SO_ERROR 0x1007 /* get error status and clear */
|
||||
#define SO_TYPE 0x1008 /* get socket type */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Structure used for manipulating linger option.
|
||||
*/
|
||||
struct linger {
|
||||
int l_onoff; /* option on/off */
|
||||
int l_linger; /* linger time */
|
||||
};
|
||||
|
||||
/*
|
||||
* Level number for (get/set)sockopt() to apply to socket itself.
|
||||
*/
|
||||
#define SOL_SOCKET 0xfff /* options for socket level */
|
||||
|
||||
|
||||
#define AF_UNSPEC 0
|
||||
#define AF_INET 2
|
||||
#define PF_INET AF_INET
|
||||
#define PF_UNSPEC AF_UNSPEC
|
||||
|
||||
#define IPPROTO_IP 0
|
||||
#define IPPROTO_TCP 6
|
||||
#define IPPROTO_UDP 17
|
||||
|
||||
#define INADDR_ANY 0
|
||||
#define INADDR_BROADCAST 0xffffffff
|
||||
|
||||
/* Flags we can use with send and recv. */
|
||||
#define MSG_DONTWAIT 0x40 /* Nonblocking i/o for this operation only */
|
||||
|
||||
|
||||
/*
|
||||
* Options for level IPPROTO_IP
|
||||
*/
|
||||
#define IP_TOS 1
|
||||
#define IP_TTL 2
|
||||
|
||||
|
||||
#define IPTOS_TOS_MASK 0x1E
|
||||
#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
|
||||
#define IPTOS_LOWDELAY 0x10
|
||||
#define IPTOS_THROUGHPUT 0x08
|
||||
#define IPTOS_RELIABILITY 0x04
|
||||
#define IPTOS_LOWCOST 0x02
|
||||
#define IPTOS_MINCOST IPTOS_LOWCOST
|
||||
|
||||
/*
|
||||
* Definitions for IP precedence (also in ip_tos) (hopefully unused)
|
||||
*/
|
||||
#define IPTOS_PREC_MASK 0xe0
|
||||
#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
|
||||
#define IPTOS_PREC_NETCONTROL 0xe0
|
||||
#define IPTOS_PREC_INTERNETCONTROL 0xc0
|
||||
#define IPTOS_PREC_CRITIC_ECP 0xa0
|
||||
#define IPTOS_PREC_FLASHOVERRIDE 0x80
|
||||
#define IPTOS_PREC_FLASH 0x60
|
||||
#define IPTOS_PREC_IMMEDIATE 0x40
|
||||
#define IPTOS_PREC_PRIORITY 0x20
|
||||
#define IPTOS_PREC_ROUTINE 0x00
|
||||
|
||||
|
||||
/*
|
||||
* Commands for ioctlsocket(), taken from the BSD file fcntl.h.
|
||||
*
|
||||
*
|
||||
* Ioctl's have the command encoded in the lower word,
|
||||
* and the size of any in or out parameters in the upper
|
||||
* word. The high 2 bits of the upper word are used
|
||||
* to encode the in/out status of the parameter; for now
|
||||
* we restrict parameters to at most 128 bytes.
|
||||
*/
|
||||
#if !defined(FIONREAD) || !defined(FIONBIO)
|
||||
#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
|
||||
#define IOC_VOID 0x20000000 /* no parameters */
|
||||
#define IOC_OUT 0x40000000 /* copy out parameters */
|
||||
#define IOC_IN 0x80000000 /* copy in parameters */
|
||||
#define IOC_INOUT (IOC_IN|IOC_OUT)
|
||||
/* 0x20000000 distinguishes new &
|
||||
old ioctl's */
|
||||
#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
|
||||
|
||||
#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||
|
||||
#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||
#endif
|
||||
|
||||
#ifndef FIONREAD
|
||||
#define FIONREAD _IOR('f', 127, unsigned long) /* get # bytes to read */
|
||||
#endif
|
||||
#ifndef FIONBIO
|
||||
#define FIONBIO _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */
|
||||
#endif
|
||||
|
||||
/* Socket I/O Controls */
|
||||
#ifndef SIOCSHIWAT
|
||||
#define SIOCSHIWAT _IOW('s', 0, unsigned long) /* set high watermark */
|
||||
#define SIOCGHIWAT _IOR('s', 1, unsigned long) /* get high watermark */
|
||||
#define SIOCSLOWAT _IOW('s', 2, unsigned long) /* set low watermark */
|
||||
#define SIOCGLOWAT _IOR('s', 3, unsigned long) /* get low watermark */
|
||||
#define SIOCATMARK _IOR('s', 7, unsigned long) /* at oob mark? */
|
||||
#endif
|
||||
|
||||
#ifndef O_NONBLOCK
|
||||
#define O_NONBLOCK 04000U
|
||||
#endif
|
||||
|
||||
#ifndef FD_SET
|
||||
#undef FD_SETSIZE
|
||||
#define FD_SETSIZE 16
|
||||
#define FD_SET(n, p) ((p)->fd_bits[(n)/8] |= (1 << ((n) & 7)))
|
||||
#define FD_CLR(n, p) ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7)))
|
||||
#define FD_ISSET(n,p) ((p)->fd_bits[(n)/8] & (1 << ((n) & 7)))
|
||||
#define FD_ZERO(p) memset((void*)(p),0,sizeof(*(p)))
|
||||
|
||||
typedef struct fd_set {
|
||||
unsigned char fd_bits [(FD_SETSIZE+7)/8];
|
||||
} fd_set;
|
||||
|
||||
/*
|
||||
* only define this in sockets.c so it does not interfere
|
||||
* with other projects namespaces where timeval is present
|
||||
*/
|
||||
#ifndef LWIP_TIMEVAL_PRIVATE
|
||||
#define LWIP_TIMEVAL_PRIVATE 1
|
||||
#endif
|
||||
|
||||
#if LWIP_TIMEVAL_PRIVATE
|
||||
struct timeval {
|
||||
long tv_sec; /* seconds */
|
||||
long tv_usec; /* and microseconds */
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
||||
int lwip_bind(int s, struct sockaddr *name, socklen_t namelen);
|
||||
int lwip_shutdown(int s, int how);
|
||||
int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen);
|
||||
int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen);
|
||||
int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen);
|
||||
int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen);
|
||||
int lwip_close(int s);
|
||||
int lwip_connect(int s, struct sockaddr *name, socklen_t namelen);
|
||||
int lwip_listen(int s, int backlog);
|
||||
int lwip_recv(int s, void *mem, int len, unsigned int flags);
|
||||
int lwip_read(int s, void *mem, int len);
|
||||
int lwip_recvfrom(int s, void *mem, int len, unsigned int flags,
|
||||
struct sockaddr *from, socklen_t *fromlen);
|
||||
int lwip_send(int s, void *dataptr, int size, unsigned int flags);
|
||||
int lwip_sendto(int s, void *dataptr, int size, unsigned int flags,
|
||||
struct sockaddr *to, socklen_t tolen);
|
||||
int lwip_socket(int domain, int type, int protocol);
|
||||
int lwip_write(int s, void *dataptr, int size);
|
||||
int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
|
||||
struct timeval *timeout);
|
||||
int lwip_ioctl(int s, long cmd, void *argp);
|
||||
|
||||
#if LWIP_COMPAT_SOCKETS
|
||||
#define accept(a,b,c) lwip_accept(a,b,c)
|
||||
#define bind(a,b,c) lwip_bind(a,b,c)
|
||||
#define shutdown(a,b) lwip_shutdown(a,b)
|
||||
#define close(s) lwip_close(s)
|
||||
#define connect(a,b,c) lwip_connect(a,b,c)
|
||||
#define getsockname(a,b,c) lwip_getsockname(a,b,c)
|
||||
#define getpeername(a,b,c) lwip_getpeername(a,b,c)
|
||||
#define setsockopt(a,b,c,d,e) lwip_setsockopt(a,b,c,d,e)
|
||||
#define getsockopt(a,b,c,d,e) lwip_getsockopt(a,b,c,d,e)
|
||||
#define listen(a,b) lwip_listen(a,b)
|
||||
#define recv(a,b,c,d) lwip_recv(a,b,c,d)
|
||||
#define read(a,b,c) lwip_read(a,b,c)
|
||||
#define recvfrom(a,b,c,d,e,f) lwip_recvfrom(a,b,c,d,e,f)
|
||||
#define send(a,b,c,d) lwip_send(a,b,c,d)
|
||||
#define sendto(a,b,c,d,e,f) lwip_sendto(a,b,c,d,e,f)
|
||||
#define socket(a,b,c) lwip_socket(a,b,c)
|
||||
#define write(a,b,c) lwip_write(a,b,c)
|
||||
#define select(a,b,c,d,e) lwip_select(a,b,c,d,e)
|
||||
#define ioctlsocket(a,b,c) lwip_ioctl(a,b,c)
|
||||
#endif /* LWIP_COMPAT_SOCKETS */
|
||||
|
||||
#endif /* __LWIP_SOCKETS_H__ */
|
||||
|
158
wii/libogc/include/lwip/stats.h
Normal file
158
wii/libogc/include/lwip/stats.h
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_STATS_H__
|
||||
#define __LWIP_STATS_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "arch/cc.h"
|
||||
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/memp.h"
|
||||
|
||||
#if LWIP_STATS
|
||||
|
||||
struct stats_proto {
|
||||
u16_t xmit; /* Transmitted packets. */
|
||||
u16_t rexmit; /* Retransmitted packets. */
|
||||
u16_t recv; /* Received packets. */
|
||||
u16_t fw; /* Forwarded packets. */
|
||||
u16_t drop; /* Dropped packets. */
|
||||
u16_t chkerr; /* Checksum error. */
|
||||
u16_t lenerr; /* Invalid length error. */
|
||||
u16_t memerr; /* Out of memory error. */
|
||||
u16_t rterr; /* Routing error. */
|
||||
u16_t proterr; /* Protocol error. */
|
||||
u16_t opterr; /* Error in options. */
|
||||
u16_t err; /* Misc error. */
|
||||
u16_t cachehit;
|
||||
};
|
||||
|
||||
struct stats_mem {
|
||||
mem_size_t avail;
|
||||
mem_size_t used;
|
||||
mem_size_t max;
|
||||
mem_size_t err;
|
||||
};
|
||||
|
||||
struct stats_pbuf {
|
||||
u16_t avail;
|
||||
u16_t used;
|
||||
u16_t max;
|
||||
u16_t err;
|
||||
|
||||
u16_t alloc_locked;
|
||||
u16_t refresh_locked;
|
||||
};
|
||||
|
||||
struct stats_syselem {
|
||||
u16_t used;
|
||||
u16_t max;
|
||||
u16_t err;
|
||||
};
|
||||
|
||||
struct stats_sys {
|
||||
struct stats_syselem sem;
|
||||
struct stats_syselem mbox;
|
||||
};
|
||||
|
||||
struct stats_ {
|
||||
struct stats_proto link;
|
||||
struct stats_proto ip_frag;
|
||||
struct stats_proto ip;
|
||||
struct stats_proto icmp;
|
||||
struct stats_proto udp;
|
||||
struct stats_proto tcp;
|
||||
struct stats_pbuf pbuf;
|
||||
struct stats_mem mem;
|
||||
struct stats_mem memp[MEMP_MAX];
|
||||
struct stats_sys sys;
|
||||
};
|
||||
|
||||
extern struct stats_ lwip_stats;
|
||||
|
||||
|
||||
void stats_init(void);
|
||||
|
||||
#define STATS_INC(x) ++lwip_stats.x
|
||||
#else
|
||||
#define stats_init()
|
||||
#define STATS_INC(x)
|
||||
#endif /* LWIP_STATS */
|
||||
|
||||
#if TCP_STATS
|
||||
#define TCP_STATS_INC(x) STATS_INC(x)
|
||||
#else
|
||||
#define TCP_STATS_INC(x)
|
||||
#endif
|
||||
|
||||
#if UDP_STATS
|
||||
#define UDP_STATS_INC(x) STATS_INC(x)
|
||||
#else
|
||||
#define UDP_STATS_INC(x)
|
||||
#endif
|
||||
|
||||
#if ICMP_STATS
|
||||
#define ICMP_STATS_INC(x) STATS_INC(x)
|
||||
#else
|
||||
#define ICMP_STATS_INC(x)
|
||||
#endif
|
||||
|
||||
#if IP_STATS
|
||||
#define IP_STATS_INC(x) STATS_INC(x)
|
||||
#else
|
||||
#define IP_STATS_INC(x)
|
||||
#endif
|
||||
|
||||
#if IPFRAG_STATS
|
||||
#define IPFRAG_STATS_INC(x) STATS_INC(x)
|
||||
#else
|
||||
#define IPFRAG_STATS_INC(x)
|
||||
#endif
|
||||
|
||||
#if LINK_STATS
|
||||
#define LINK_STATS_INC(x) STATS_INC(x)
|
||||
#else
|
||||
#define LINK_STATS_INC(x)
|
||||
#endif
|
||||
|
||||
/* Display of statistics */
|
||||
#if LWIP_STATS_DISPLAY
|
||||
void stats_display(void);
|
||||
#else
|
||||
#define stats_display()
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_STATS_H__ */
|
||||
|
||||
|
||||
|
||||
|
183
wii/libogc/include/lwip/sys.h
Normal file
183
wii/libogc/include/lwip/sys.h
Normal file
@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_SYS_H__
|
||||
#define __LWIP_SYS_H__
|
||||
|
||||
#include "arch/cc.h"
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
|
||||
#if NO_SYS
|
||||
|
||||
/* For a totally minimal and standalone system, we provide null
|
||||
definitions of the sys_ functions. */
|
||||
#include "arch/sys_arch.h"
|
||||
|
||||
struct sys_timeout {u8_t dummy;};
|
||||
|
||||
#define sys_init()
|
||||
#define sys_timeout(m,h,a)
|
||||
#define sys_untimeout(m,a)
|
||||
#define sys_sem_new(c) c
|
||||
#define sys_sem_signal(s)
|
||||
#define sys_sem_wait(s)
|
||||
#define sys_sem_free(s)
|
||||
#define sys_mbox_new() 0
|
||||
#define sys_mbox_fetch(m,d)
|
||||
#define sys_mbox_post(m,d)
|
||||
#define sys_mbox_free(m)
|
||||
|
||||
#define sys_thread_new(t,a,p)
|
||||
|
||||
#else /* NO_SYS */
|
||||
|
||||
#include "arch/sys_arch.h"
|
||||
|
||||
/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */
|
||||
#define SYS_ARCH_TIMEOUT 0xffffffff
|
||||
|
||||
typedef void (* sys_timeout_handler)(void *arg);
|
||||
|
||||
struct sys_timeout {
|
||||
struct sys_timeout *next;
|
||||
u32_t time;
|
||||
sys_timeout_handler h;
|
||||
void *arg;
|
||||
};
|
||||
|
||||
struct sys_timeouts {
|
||||
struct sys_timeout *next;
|
||||
};
|
||||
|
||||
/* sys_init() must be called before anthing else. */
|
||||
void sys_init(void);
|
||||
|
||||
/*
|
||||
* sys_timeout():
|
||||
*
|
||||
* Schedule a timeout a specified amount of milliseconds in the
|
||||
* future. When the timeout occurs, the specified timeout handler will
|
||||
* be called. The handler will be passed the "arg" argument when
|
||||
* called.
|
||||
*
|
||||
*/
|
||||
void sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg);
|
||||
void sys_untimeout(sys_timeout_handler h, void *arg);
|
||||
struct sys_timeouts *sys_arch_timeouts(void);
|
||||
|
||||
/* Semaphore functions. */
|
||||
sys_sem_t sys_sem_new(u8_t count);
|
||||
void sys_sem_signal(sys_sem_t sem);
|
||||
u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout);
|
||||
void sys_sem_free(sys_sem_t sem);
|
||||
void sys_sem_wait(sys_sem_t sem);
|
||||
int sys_sem_wait_timeout(sys_sem_t sem, u32_t timeout);
|
||||
|
||||
/* Time functions. */
|
||||
#ifndef sys_msleep
|
||||
void sys_msleep(u32_t ms); /* only has a (close to) 1 jiffy resolution. */
|
||||
#endif
|
||||
#ifndef sys_jiffies
|
||||
u32_t sys_jiffies(void); /* since power up. */
|
||||
#endif
|
||||
|
||||
/* Mailbox functions. */
|
||||
sys_mbox_t sys_mbox_new(void);
|
||||
void sys_mbox_post(sys_mbox_t mbox, void *msg);
|
||||
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout);
|
||||
void sys_mbox_free(sys_mbox_t mbox);
|
||||
void sys_mbox_fetch(sys_mbox_t mbox, void **msg);
|
||||
|
||||
|
||||
/* Thread functions. */
|
||||
sys_thread_t sys_thread_new(void (* thread)(void *arg), void *arg, int prio);
|
||||
|
||||
/* The following functions are used only in Unix code, and
|
||||
can be omitted when porting the stack. */
|
||||
/* Returns the current time in microseconds. */
|
||||
unsigned long sys_now(void);
|
||||
|
||||
#endif /* NO_SYS */
|
||||
|
||||
/* Critical Region Protection */
|
||||
/* These functions must be implemented in the sys_arch.c file.
|
||||
In some implementations they can provide a more light-weight protection
|
||||
mechanism than using semaphores. Otherwise semaphores can be used for
|
||||
implementation */
|
||||
#ifndef SYS_ARCH_PROTECT
|
||||
/** SYS_LIGHTWEIGHT_PROT
|
||||
* define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
|
||||
* for certain critical regions during buffer allocation, deallocation and memory
|
||||
* allocation and deallocation.
|
||||
*/
|
||||
#if SYS_LIGHTWEIGHT_PROT
|
||||
|
||||
/** SYS_ARCH_DECL_PROTECT
|
||||
* declare a protection variable. This macro will default to defining a variable of
|
||||
* type sys_prot_t. If a particular port needs a different implementation, then
|
||||
* this macro may be defined in sys_arch.h.
|
||||
*/
|
||||
#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev
|
||||
/** SYS_ARCH_PROTECT
|
||||
* Perform a "fast" protect. This could be implemented by
|
||||
* disabling interrupts for an embedded system or by using a semaphore or
|
||||
* mutex. The implementation should allow calling SYS_ARCH_PROTECT when
|
||||
* already protected. The old protection level is returned in the variable
|
||||
* "lev". This macro will default to calling the sys_arch_protect() function
|
||||
* which should be implemented in sys_arch.c. If a particular port needs a
|
||||
* different implementation, then this macro may be defined in sys_arch.h
|
||||
*/
|
||||
#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()
|
||||
/** SYS_ARCH_UNPROTECT
|
||||
* Perform a "fast" set of the protection level to "lev". This could be
|
||||
* implemented by setting the interrupt level to "lev" within the MACRO or by
|
||||
* using a semaphore or mutex. This macro will default to calling the
|
||||
* sys_arch_unprotect() function which should be implemented in
|
||||
* sys_arch.c. If a particular port needs a different implementation, then
|
||||
* this macro may be defined in sys_arch.h
|
||||
*/
|
||||
#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)
|
||||
sys_prot_t sys_arch_protect(void);
|
||||
void sys_arch_unprotect(sys_prot_t pval);
|
||||
|
||||
#else
|
||||
|
||||
#define SYS_ARCH_DECL_PROTECT(lev)
|
||||
#define SYS_ARCH_PROTECT(lev)
|
||||
#define SYS_ARCH_UNPROTECT(lev)
|
||||
|
||||
#endif /* SYS_LIGHTWEIGHT_PROT */
|
||||
|
||||
#endif /* SYS_ARCH_PROTECT */
|
||||
|
||||
#endif /* __LWIP_SYS_H__ */
|
533
wii/libogc/include/lwip/tcp.h
Normal file
533
wii/libogc/include/lwip/tcp.h
Normal file
@ -0,0 +1,533 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_TCP_H__
|
||||
#define __LWIP_TCP_H__
|
||||
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/mem.h"
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/icmp.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
struct tcp_pcb;
|
||||
|
||||
/* Functions for interfacing with TCP: */
|
||||
|
||||
/* Lower layer interface to TCP: */
|
||||
void tcp_init (void); /* Must be called first to
|
||||
initialize TCP. */
|
||||
void tcp_tmr (void); /* Must be called every
|
||||
TCP_TMR_INTERVAL
|
||||
ms. (Typically 250 ms). */
|
||||
/* Application program's interface: */
|
||||
struct tcp_pcb * tcp_new (void);
|
||||
struct tcp_pcb * tcp_alloc (u8_t prio);
|
||||
|
||||
void tcp_arg (struct tcp_pcb *pcb, void *arg);
|
||||
void tcp_accept (struct tcp_pcb *pcb,
|
||||
err_t (* accept)(void *arg, struct tcp_pcb *newpcb,
|
||||
err_t err));
|
||||
void tcp_recv (struct tcp_pcb *pcb,
|
||||
err_t (* recv)(void *arg, struct tcp_pcb *tpcb,
|
||||
struct pbuf *p, err_t err));
|
||||
void tcp_sent (struct tcp_pcb *pcb,
|
||||
err_t (* sent)(void *arg, struct tcp_pcb *tpcb,
|
||||
u16_t len));
|
||||
void tcp_poll (struct tcp_pcb *pcb,
|
||||
err_t (* poll)(void *arg, struct tcp_pcb *tpcb),
|
||||
u8_t interval);
|
||||
void tcp_err (struct tcp_pcb *pcb,
|
||||
void (* err)(void *arg, err_t err));
|
||||
|
||||
#define tcp_mss(pcb) ((pcb)->mss)
|
||||
#define tcp_sndbuf(pcb) ((pcb)->snd_buf)
|
||||
|
||||
void tcp_recved (struct tcp_pcb *pcb, u16_t len);
|
||||
err_t tcp_bind (struct tcp_pcb *pcb, struct ip_addr *ipaddr,
|
||||
u16_t port);
|
||||
err_t tcp_connect (struct tcp_pcb *pcb, struct ip_addr *ipaddr,
|
||||
u16_t port, err_t (* connected)(void *arg,
|
||||
struct tcp_pcb *tpcb,
|
||||
err_t err));
|
||||
struct tcp_pcb * tcp_listen (struct tcp_pcb *pcb);
|
||||
void tcp_abort (struct tcp_pcb *pcb);
|
||||
err_t tcp_close (struct tcp_pcb *pcb);
|
||||
err_t tcp_write (struct tcp_pcb *pcb, const void *dataptr, u16_t len,
|
||||
u8_t copy);
|
||||
|
||||
void tcp_setprio (struct tcp_pcb *pcb, u8_t prio);
|
||||
|
||||
#define TCP_PRIO_MIN 1
|
||||
#define TCP_PRIO_NORMAL 64
|
||||
#define TCP_PRIO_MAX 127
|
||||
|
||||
/* It is also possible to call these two functions at the right
|
||||
intervals (instead of calling tcp_tmr()). */
|
||||
void tcp_slowtmr (void);
|
||||
void tcp_fasttmr (void);
|
||||
|
||||
|
||||
/* Only used by IP to pass a TCP segment to TCP: */
|
||||
void tcp_input (struct pbuf *p, struct netif *inp);
|
||||
/* Used within the TCP code only: */
|
||||
err_t tcp_output (struct tcp_pcb *pcb);
|
||||
void tcp_rexmit (struct tcp_pcb *pcb);
|
||||
void tcp_rexmit_rto (struct tcp_pcb *pcb);
|
||||
|
||||
|
||||
|
||||
#define TCP_SEQ_LT(a,b) ((s32_t)((a)-(b)) < 0)
|
||||
#define TCP_SEQ_LEQ(a,b) ((s32_t)((a)-(b)) <= 0)
|
||||
#define TCP_SEQ_GT(a,b) ((s32_t)((a)-(b)) > 0)
|
||||
#define TCP_SEQ_GEQ(a,b) ((s32_t)((a)-(b)) >= 0)
|
||||
/* is b<=a<=c? */
|
||||
#if 0 /* see bug #10548 */
|
||||
#define TCP_SEQ_BETWEEN(a,b,c) ((c)-(b) >= (a)-(b))
|
||||
#endif
|
||||
#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c))
|
||||
#define TCP_FIN 0x01U
|
||||
#define TCP_SYN 0x02U
|
||||
#define TCP_RST 0x04U
|
||||
#define TCP_PSH 0x08U
|
||||
#define TCP_ACK 0x10U
|
||||
#define TCP_URG 0x20U
|
||||
#define TCP_ECE 0x40U
|
||||
#define TCP_CWR 0x80U
|
||||
|
||||
#define TCP_FLAGS 0x3fU
|
||||
|
||||
/* Length of the TCP header, excluding options. */
|
||||
#define TCP_HLEN 20
|
||||
|
||||
#ifndef TCP_TMR_INTERVAL
|
||||
#define TCP_TMR_INTERVAL 250 /* The TCP timer interval in
|
||||
milliseconds. */
|
||||
#endif /* TCP_TMR_INTERVAL */
|
||||
|
||||
#ifndef TCP_FAST_INTERVAL
|
||||
#define TCP_FAST_INTERVAL TCP_TMR_INTERVAL /* the fine grained timeout in
|
||||
milliseconds */
|
||||
#endif /* TCP_FAST_INTERVAL */
|
||||
|
||||
#ifndef TCP_SLOW_INTERVAL
|
||||
#define TCP_SLOW_INTERVAL (2*TCP_TMR_INTERVAL) /* the coarse grained timeout in
|
||||
milliseconds */
|
||||
#endif /* TCP_SLOW_INTERVAL */
|
||||
|
||||
#define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */
|
||||
#define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */
|
||||
|
||||
#define TCP_OOSEQ_TIMEOUT 6 /* x RTO */
|
||||
|
||||
#define TCP_MSL 60000 /* The maximum segment lifetime in microseconds */
|
||||
|
||||
/*
|
||||
* User-settable options (used with setsockopt).
|
||||
*/
|
||||
#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
|
||||
#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keepalive miliseconds */
|
||||
|
||||
/* Keepalive values */
|
||||
#define TCP_KEEPDEFAULT 7200000 /* KEEPALIVE timer in miliseconds */
|
||||
#define TCP_KEEPINTVL 75000 /* Time between KEEPALIVE probes in miliseconds */
|
||||
#define TCP_KEEPCNT 9 /* Counter for KEEPALIVE probes */
|
||||
#define TCP_MAXIDLE TCP_KEEPCNT * TCP_KEEPINTVL /* Maximum KEEPALIVE probe time */
|
||||
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct tcp_hdr {
|
||||
PACK_STRUCT_FIELD(u16_t src);
|
||||
PACK_STRUCT_FIELD(u16_t dest);
|
||||
PACK_STRUCT_FIELD(u32_t seqno);
|
||||
PACK_STRUCT_FIELD(u32_t ackno);
|
||||
PACK_STRUCT_FIELD(u16_t _hdrlen_rsvd_flags);
|
||||
PACK_STRUCT_FIELD(u16_t wnd);
|
||||
PACK_STRUCT_FIELD(u16_t chksum);
|
||||
PACK_STRUCT_FIELD(u16_t urgp);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#define TCPH_OFFSET(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 8)
|
||||
#define TCPH_HDRLEN(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 12)
|
||||
#define TCPH_FLAGS(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS)
|
||||
|
||||
#define TCPH_OFFSET_SET(phdr, offset) (phdr)->_hdrlen_rsvd_flags = htons(((offset) << 8) | TCPH_FLAGS(phdr))
|
||||
#define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | TCPH_FLAGS(phdr))
|
||||
#define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons((ntohs((phdr)->_hdrlen_rsvd_flags) & ~TCP_FLAGS) | (flags))
|
||||
#define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (flags))
|
||||
#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (TCPH_FLAGS(phdr) & ~(flags)) )
|
||||
|
||||
#define TCP_TCPLEN(seg) ((seg)->len + ((TCPH_FLAGS((seg)->tcphdr) & TCP_FIN || \
|
||||
TCPH_FLAGS((seg)->tcphdr) & TCP_SYN)? 1: 0))
|
||||
|
||||
enum tcp_state {
|
||||
CLOSED = 0,
|
||||
LISTEN = 1,
|
||||
SYN_SENT = 2,
|
||||
SYN_RCVD = 3,
|
||||
ESTABLISHED = 4,
|
||||
FIN_WAIT_1 = 5,
|
||||
FIN_WAIT_2 = 6,
|
||||
CLOSE_WAIT = 7,
|
||||
CLOSING = 8,
|
||||
LAST_ACK = 9,
|
||||
TIME_WAIT = 10
|
||||
};
|
||||
|
||||
/* the TCP protocol control block */
|
||||
struct tcp_pcb {
|
||||
/** common PCB members */
|
||||
IP_PCB;
|
||||
/** protocol specific PCB members */
|
||||
struct tcp_pcb *next; /* for the linked list */
|
||||
enum tcp_state state; /* TCP state */
|
||||
u8_t prio;
|
||||
void *callback_arg;
|
||||
|
||||
u16_t local_port;
|
||||
u16_t remote_port;
|
||||
|
||||
u8_t flags;
|
||||
#define TF_ACK_DELAY (u8_t)0x01U /* Delayed ACK. */
|
||||
#define TF_ACK_NOW (u8_t)0x02U /* Immediate ACK. */
|
||||
#define TF_INFR (u8_t)0x04U /* In fast recovery. */
|
||||
#define TF_RESET (u8_t)0x08U /* Connection was reset. */
|
||||
#define TF_CLOSED (u8_t)0x10U /* Connection was sucessfully closed. */
|
||||
#define TF_GOT_FIN (u8_t)0x20U /* Connection was closed by the remote end. */
|
||||
#define TF_NODELAY (u8_t)0x40U /* Disable Nagle algorithm */
|
||||
|
||||
/* receiver variables */
|
||||
u32_t rcv_nxt; /* next seqno expected */
|
||||
u16_t rcv_wnd; /* receiver window */
|
||||
|
||||
/* Timers */
|
||||
u32_t tmr;
|
||||
u8_t polltmr, pollinterval;
|
||||
|
||||
/* Retransmission timer. */
|
||||
u16_t rtime;
|
||||
|
||||
u16_t mss; /* maximum segment size */
|
||||
|
||||
/* RTT (round trip time) estimation variables */
|
||||
u32_t rttest; /* RTT estimate in 500ms ticks */
|
||||
u32_t rtseq; /* sequence number being timed */
|
||||
s16_t sa, sv; /* @todo document this */
|
||||
|
||||
u16_t rto; /* retransmission time-out */
|
||||
u8_t nrtx; /* number of retransmissions */
|
||||
|
||||
/* fast retransmit/recovery */
|
||||
u32_t lastack; /* Highest acknowledged seqno. */
|
||||
u8_t dupacks;
|
||||
|
||||
/* congestion avoidance/control variables */
|
||||
u16_t cwnd;
|
||||
u16_t ssthresh;
|
||||
|
||||
/* sender variables */
|
||||
u32_t snd_nxt, /* next seqno to be sent */
|
||||
snd_max, /* Highest seqno sent. */
|
||||
snd_wnd, /* sender window */
|
||||
snd_wl1, snd_wl2, /* Sequence and acknowledgement numbers of last
|
||||
window update. */
|
||||
snd_lbb; /* Sequence number of next byte to be buffered. */
|
||||
|
||||
u16_t acked;
|
||||
|
||||
u16_t snd_buf; /* Available buffer space for sending (in bytes). */
|
||||
u16_t snd_queuelen; /* Available buffer space for sending (in tcp_segs). */
|
||||
|
||||
|
||||
/* These are ordered by sequence number: */
|
||||
struct tcp_seg *unsent; /* Unsent (queued) segments. */
|
||||
struct tcp_seg *unacked; /* Sent but unacknowledged segments. */
|
||||
#if TCP_QUEUE_OOSEQ
|
||||
struct tcp_seg *ooseq; /* Received out of sequence segments. */
|
||||
#endif /* TCP_QUEUE_OOSEQ */
|
||||
|
||||
#if LWIP_CALLBACK_API
|
||||
/* Function to be called when more send buffer space is available. */
|
||||
err_t (* sent)(void *arg, struct tcp_pcb *pcb, u16_t space);
|
||||
|
||||
/* Function to be called when (in-sequence) data has arrived. */
|
||||
err_t (* recv)(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err);
|
||||
|
||||
/* Function to be called when a connection has been set up. */
|
||||
err_t (* connected)(void *arg, struct tcp_pcb *pcb, err_t err);
|
||||
|
||||
/* Function to call when a listener has been connected. */
|
||||
err_t (* accept)(void *arg, struct tcp_pcb *newpcb, err_t err);
|
||||
|
||||
/* Function which is called periodically. */
|
||||
err_t (* poll)(void *arg, struct tcp_pcb *pcb);
|
||||
|
||||
/* Function to be called whenever a fatal error occurs. */
|
||||
void (* errf)(void *arg, err_t err);
|
||||
#endif /* LWIP_CALLBACK_API */
|
||||
|
||||
/* idle time before KEEPALIVE is sent */
|
||||
u32_t keepalive;
|
||||
|
||||
/* KEEPALIVE counter */
|
||||
u8_t keep_cnt;
|
||||
};
|
||||
|
||||
struct tcp_pcb_listen {
|
||||
/* Common members of all PCB types */
|
||||
IP_PCB;
|
||||
|
||||
/* Protocol specific PCB members */
|
||||
struct tcp_pcb_listen *next; /* for the linked list */
|
||||
|
||||
/* Even if state is obviously LISTEN this is here for
|
||||
* field compatibility with tpc_pcb to which it is cast sometimes
|
||||
* Until a cleaner solution emerges this is here.FIXME
|
||||
*/
|
||||
enum tcp_state state; /* TCP state */
|
||||
|
||||
u8_t prio;
|
||||
void *callback_arg;
|
||||
|
||||
u16_t local_port;
|
||||
|
||||
#if LWIP_CALLBACK_API
|
||||
/* Function to call when a listener has been connected. */
|
||||
err_t (* accept)(void *arg, struct tcp_pcb *newpcb, err_t err);
|
||||
#endif /* LWIP_CALLBACK_API */
|
||||
};
|
||||
|
||||
#if LWIP_EVENT_API
|
||||
|
||||
enum lwip_event {
|
||||
LWIP_EVENT_ACCEPT,
|
||||
LWIP_EVENT_SENT,
|
||||
LWIP_EVENT_RECV,
|
||||
LWIP_EVENT_CONNECTED,
|
||||
LWIP_EVENT_POLL,
|
||||
LWIP_EVENT_ERR
|
||||
};
|
||||
|
||||
err_t lwip_tcp_event(void *arg, struct tcp_pcb *pcb,
|
||||
enum lwip_event,
|
||||
struct pbuf *p,
|
||||
u16_t size,
|
||||
err_t err);
|
||||
|
||||
#define TCP_EVENT_ACCEPT(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
|
||||
LWIP_EVENT_ACCEPT, NULL, 0, err)
|
||||
#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
|
||||
LWIP_EVENT_SENT, NULL, space, ERR_OK)
|
||||
#define TCP_EVENT_RECV(pcb,p,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
|
||||
LWIP_EVENT_RECV, (p), 0, (err))
|
||||
#define TCP_EVENT_CONNECTED(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
|
||||
LWIP_EVENT_CONNECTED, NULL, 0, (err))
|
||||
#define TCP_EVENT_POLL(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
|
||||
LWIP_EVENT_POLL, NULL, 0, ERR_OK)
|
||||
#define TCP_EVENT_ERR(errf,arg,err) lwip_tcp_event((arg), NULL, \
|
||||
LWIP_EVENT_ERR, NULL, 0, (err))
|
||||
#else /* LWIP_EVENT_API */
|
||||
#define TCP_EVENT_ACCEPT(pcb,err,ret) \
|
||||
if((pcb)->accept != NULL) \
|
||||
(ret = (pcb)->accept((pcb)->callback_arg,(pcb),(err)))
|
||||
#define TCP_EVENT_SENT(pcb,space,ret) \
|
||||
if((pcb)->sent != NULL) \
|
||||
(ret = (pcb)->sent((pcb)->callback_arg,(pcb),(space)))
|
||||
#define TCP_EVENT_RECV(pcb,p,err,ret) \
|
||||
if((pcb)->recv != NULL) \
|
||||
{ ret = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err)); } else { \
|
||||
if (p) pbuf_free(p); }
|
||||
#define TCP_EVENT_CONNECTED(pcb,err,ret) \
|
||||
if((pcb)->connected != NULL) \
|
||||
(ret = (pcb)->connected((pcb)->callback_arg,(pcb),(err)))
|
||||
#define TCP_EVENT_POLL(pcb,ret) \
|
||||
if((pcb)->poll != NULL) \
|
||||
(ret = (pcb)->poll((pcb)->callback_arg,(pcb)))
|
||||
#define TCP_EVENT_ERR(errf,arg,err) \
|
||||
if((errf) != NULL) \
|
||||
(errf)((arg),(err))
|
||||
#endif /* LWIP_EVENT_API */
|
||||
|
||||
/* This structure represents a TCP segment on the unsent and unacked queues */
|
||||
struct tcp_seg {
|
||||
struct tcp_seg *next; /* used when putting segements on a queue */
|
||||
struct pbuf *p; /* buffer containing data + TCP header */
|
||||
void *dataptr; /* pointer to the TCP data in the pbuf */
|
||||
u16_t len; /* the TCP length of this segment */
|
||||
struct tcp_hdr *tcphdr; /* the TCP header */
|
||||
};
|
||||
|
||||
/* Internal functions and global variables: */
|
||||
struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb);
|
||||
void tcp_pcb_purge(struct tcp_pcb *pcb);
|
||||
void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb);
|
||||
|
||||
u8_t tcp_segs_free(struct tcp_seg *seg);
|
||||
u8_t tcp_seg_free(struct tcp_seg *seg);
|
||||
struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg);
|
||||
|
||||
#define tcp_ack(pcb) if((pcb)->flags & TF_ACK_DELAY) { \
|
||||
(pcb)->flags &= ~TF_ACK_DELAY; \
|
||||
(pcb)->flags |= TF_ACK_NOW; \
|
||||
tcp_output(pcb); \
|
||||
} else { \
|
||||
(pcb)->flags |= TF_ACK_DELAY; \
|
||||
}
|
||||
|
||||
#define tcp_ack_now(pcb) (pcb)->flags |= TF_ACK_NOW; \
|
||||
tcp_output(pcb)
|
||||
|
||||
err_t tcp_send_ctrl(struct tcp_pcb *pcb, u8_t flags);
|
||||
err_t tcp_enqueue(struct tcp_pcb *pcb, void *dataptr, u16_t len,
|
||||
u8_t flags, u8_t copy,
|
||||
u8_t *optdata, u8_t optlen);
|
||||
|
||||
void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg);
|
||||
|
||||
void tcp_rst(u32_t seqno, u32_t ackno,
|
||||
struct ip_addr *local_ip, struct ip_addr *remote_ip,
|
||||
u16_t local_port, u16_t remote_port);
|
||||
|
||||
u32_t tcp_next_iss(void);
|
||||
|
||||
void tcp_keepalive(struct tcp_pcb *pcb);
|
||||
|
||||
extern struct tcp_pcb *tcp_input_pcb;
|
||||
extern u32_t tcp_ticks;
|
||||
|
||||
#if TCP_DEBUG || TCP_INPUT_DEBUG || TCP_OUTPUT_DEBUG
|
||||
void tcp_debug_print(struct tcp_hdr *tcphdr);
|
||||
void tcp_debug_print_flags(u8_t flags);
|
||||
void tcp_debug_print_state(enum tcp_state s);
|
||||
void tcp_debug_print_pcbs(void);
|
||||
s16_t tcp_pcbs_sane(void);
|
||||
#else
|
||||
# define tcp_debug_print(tcphdr)
|
||||
# define tcp_debug_print_flags(flags)
|
||||
# define tcp_debug_print_state(s)
|
||||
# define tcp_debug_print_pcbs()
|
||||
# define tcp_pcbs_sane() 1
|
||||
#endif /* TCP_DEBUG */
|
||||
/*
|
||||
#if NO_SYS
|
||||
#define tcp_timer_needed()
|
||||
#else
|
||||
void tcp_timer_needed(void);
|
||||
#endif
|
||||
*/
|
||||
void tcp_timer_needed(void);
|
||||
|
||||
/* The TCP PCB lists. */
|
||||
union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */
|
||||
struct tcp_pcb_listen *listen_pcbs;
|
||||
struct tcp_pcb *pcbs;
|
||||
};
|
||||
extern union tcp_listen_pcbs_t tcp_listen_pcbs;
|
||||
extern struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a
|
||||
state in which they accept or send
|
||||
data. */
|
||||
extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */
|
||||
|
||||
extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */
|
||||
|
||||
/* Axioms about the above lists:
|
||||
1) Every TCP PCB that is not CLOSED is in one of the lists.
|
||||
2) A PCB is only in one of the lists.
|
||||
3) All PCBs in the tcp_listen_pcbs list is in LISTEN state.
|
||||
4) All PCBs in the tcp_tw_pcbs list is in TIME-WAIT state.
|
||||
*/
|
||||
|
||||
/* Define two macros, TCP_REG and TCP_RMV that registers a TCP PCB
|
||||
with a PCB list or removes a PCB from a list, respectively. */
|
||||
#if 0
|
||||
#define TCP_REG(pcbs, npcb) do {\
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %d\n", npcb, npcb->local_port)); \
|
||||
for(tcp_tmp_pcb = *pcbs; \
|
||||
tcp_tmp_pcb != NULL; \
|
||||
tcp_tmp_pcb = tcp_tmp_pcb->next) { \
|
||||
LWIP_ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != npcb); \
|
||||
} \
|
||||
LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", npcb->state != CLOSED); \
|
||||
npcb->next = *pcbs; \
|
||||
LWIP_ASSERT("TCP_REG: npcb->next != npcb", npcb->next != npcb); \
|
||||
*(pcbs) = npcb; \
|
||||
LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \
|
||||
tcp_timer_needed(); \
|
||||
} while(0)
|
||||
#define TCP_RMV(pcbs, npcb) do { \
|
||||
LWIP_ASSERT("TCP_RMV: pcbs != NULL", *pcbs != NULL); \
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", npcb, *pcbs)); \
|
||||
if(*pcbs == npcb) { \
|
||||
*pcbs = (*pcbs)->next; \
|
||||
} else for(tcp_tmp_pcb = *pcbs; tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \
|
||||
if(tcp_tmp_pcb->next != NULL && tcp_tmp_pcb->next == npcb) { \
|
||||
tcp_tmp_pcb->next = npcb->next; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
npcb->next = NULL; \
|
||||
LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removed %p from %p\n", npcb, *pcbs)); \
|
||||
} while(0)
|
||||
|
||||
#else /* LWIP_DEBUG */
|
||||
#define TCP_REG(pcbs, npcb) do { \
|
||||
npcb->next = *pcbs; \
|
||||
*(pcbs) = npcb; \
|
||||
tcp_timer_needed(); \
|
||||
} while(0)
|
||||
#define TCP_RMV(pcbs, npcb) do { \
|
||||
if(*(pcbs) == npcb) { \
|
||||
(*(pcbs)) = (*pcbs)->next; \
|
||||
} else for(tcp_tmp_pcb = *pcbs; tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \
|
||||
if(tcp_tmp_pcb->next != NULL && tcp_tmp_pcb->next == npcb) { \
|
||||
tcp_tmp_pcb->next = npcb->next; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
npcb->next = NULL; \
|
||||
} while(0)
|
||||
#endif /* LWIP_DEBUG */
|
||||
#endif /* __LWIP_TCP_H__ */
|
||||
|
||||
|
||||
|
59
wii/libogc/include/lwip/tcpip.h
Normal file
59
wii/libogc/include/lwip/tcpip.h
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_TCPIP_H__
|
||||
#define __LWIP_TCPIP_H__
|
||||
|
||||
#include "lwip/api_msg.h"
|
||||
#include "lwip/pbuf.h"
|
||||
|
||||
enum netmsq_type {
|
||||
NETMSG_API,
|
||||
NETMSG_INPUT,
|
||||
NETMSG_CALLBACK
|
||||
};
|
||||
|
||||
struct net_msg {
|
||||
enum netmsq_type type;
|
||||
union {
|
||||
struct api_msg *apimsg;
|
||||
struct {
|
||||
struct pbuf *p;
|
||||
struct netif *net;
|
||||
} inp;
|
||||
struct {
|
||||
void (*f)(void *);
|
||||
void *ctx;
|
||||
} cb;
|
||||
} msg;
|
||||
};
|
||||
|
||||
#endif /* __LWIP_TCPIP_H__ */
|
104
wii/libogc/include/lwip/udp.h
Normal file
104
wii/libogc/include/lwip/udp.h
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LWIP_UDP_H__
|
||||
#define __LWIP_UDP_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/ip.h"
|
||||
|
||||
#define UDP_HLEN 8
|
||||
|
||||
struct udp_hdr {
|
||||
PACK_STRUCT_FIELD(u16_t src);
|
||||
PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */
|
||||
PACK_STRUCT_FIELD(u16_t len);
|
||||
PACK_STRUCT_FIELD(u16_t chksum);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
|
||||
#define UDP_FLAGS_NOCHKSUM 0x01U
|
||||
#define UDP_FLAGS_UDPLITE 0x02U
|
||||
#define UDP_FLAGS_CONNECTED 0x04U
|
||||
|
||||
struct udp_pcb {
|
||||
/* Common members of all PCB types */
|
||||
IP_PCB;
|
||||
|
||||
/* Protocol specific PCB members */
|
||||
|
||||
struct udp_pcb *next;
|
||||
|
||||
u8_t flags;
|
||||
u16_t local_port, remote_port;
|
||||
|
||||
u16_t chksum_len;
|
||||
|
||||
void (* recv)(void *arg, struct udp_pcb *pcb, struct pbuf *p,
|
||||
struct ip_addr *addr, u16_t port);
|
||||
void *recv_arg;
|
||||
};
|
||||
|
||||
/* The following functions is the application layer interface to the
|
||||
UDP code. */
|
||||
struct udp_pcb * udp_new (void);
|
||||
void udp_remove (struct udp_pcb *pcb);
|
||||
err_t udp_bind (struct udp_pcb *pcb, struct ip_addr *ipaddr,
|
||||
u16_t port);
|
||||
err_t udp_connect (struct udp_pcb *pcb, struct ip_addr *ipaddr,
|
||||
u16_t port);
|
||||
void udp_disconnect (struct udp_pcb *pcb);
|
||||
void udp_recv (struct udp_pcb *pcb,
|
||||
void (* recv)(void *arg, struct udp_pcb *upcb,
|
||||
struct pbuf *p,
|
||||
struct ip_addr *addr,
|
||||
u16_t port),
|
||||
void *recv_arg);
|
||||
err_t udp_sendto (struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *dst_ip, u16_t dst_port);
|
||||
err_t udp_send (struct udp_pcb *pcb, struct pbuf *p);
|
||||
|
||||
#define udp_flags(pcb) ((pcb)->flags)
|
||||
#define udp_setflags(pcb, f) ((pcb)->flags = (f))
|
||||
|
||||
/* The following functions are the lower layer interface to UDP. */
|
||||
void udp_input (struct pbuf *p, struct netif *inp);
|
||||
void udp_init (void);
|
||||
|
||||
#if UDP_DEBUG
|
||||
void udp_debug_print(struct udp_hdr *udphdr);
|
||||
#else
|
||||
#define udp_debug_print(udphdr)
|
||||
#endif
|
||||
#endif /* __LWIP_UDP_H__ */
|
||||
|
||||
|
73
wii/libogc/include/netif/arch/cc.h
Normal file
73
wii/libogc/include/netif/arch/cc.h
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __ARCH_CC_H__
|
||||
#define __ARCH_CC_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <gctypes.h>
|
||||
#include "asm.h"
|
||||
#include "processor.h"
|
||||
|
||||
typedef u8 u8_t;
|
||||
typedef s8 s8_t;
|
||||
typedef u16 u16_t;
|
||||
typedef s16 s16_t;
|
||||
typedef u32 u32_t;
|
||||
typedef s32 s32_t;
|
||||
typedef u32 mem_ptr_t;
|
||||
|
||||
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
#define PACK_STRUCT_STRUCT __attribute__((packed))
|
||||
#define PACK_STRUCT_BEGIN
|
||||
#define PACK_STRUCT_END
|
||||
|
||||
#define LWIP_PLATFORM_ASSERT(x) { printf(x); while (1); }
|
||||
#define LWIP_PLATFORM_DIAG(x) printf x
|
||||
|
||||
#define SYS_ARCH_DECL_PROTECT(lev) u32 lev
|
||||
#define SYS_ARCH_PROTECT(lev) _CPU_ISR_Disable(lev)
|
||||
#define SYS_ARCH_UNPROTECT(lev) _CPU_ISR_Restore(lev)
|
||||
|
||||
/* Define (sn)printf formatters for these lwIP types */
|
||||
#define U16_F "hu"
|
||||
#define S16_F "hd"
|
||||
#define X16_F "hx"
|
||||
#define U32_F "u"
|
||||
#define S32_F "d"
|
||||
#define X32_F "x"
|
||||
|
||||
|
||||
#endif /* __ARCH_CC_H__ */
|
39
wii/libogc/include/netif/arch/cpu.h
Normal file
39
wii/libogc/include/netif/arch/cpu.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __CPU_H__
|
||||
#define __CPU_H__
|
||||
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
|
||||
#endif /* __CPU_H__ */
|
46
wii/libogc/include/netif/arch/init.h
Normal file
46
wii/libogc/include/netif/arch/init.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __ARCH_INIT_H__
|
||||
#define __ARCH_INIT_H__
|
||||
|
||||
#define TCPIP_INIT_DONE(arg) tcpip_init_done(arg)
|
||||
|
||||
void tcpip_init_done(void *);
|
||||
int wait_for_tcpip_init(void);
|
||||
|
||||
#endif /* __ARCH_INIT_H__ */
|
||||
|
||||
|
||||
|
||||
|
42
wii/libogc/include/netif/arch/lib.h
Normal file
42
wii/libogc/include/netif/arch/lib.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __LIB_H__
|
||||
#define __LIB_H__
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define bcopy(s, d, l) memcpy(d, s, l)
|
||||
#define bzero(d, l) memset(d, 0, l)
|
||||
|
||||
#endif /* __LIB_H__ */
|
40
wii/libogc/include/netif/arch/perf.h
Normal file
40
wii/libogc/include/netif/arch/perf.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __PERF_H__
|
||||
#define __PERF_H__
|
||||
|
||||
#define PERF_START /* null definition */
|
||||
#define PERF_STOP(x) /* null definition */
|
||||
|
||||
#endif /* __PERF_H__ */
|
55
wii/libogc/include/netif/arch/sys_arch.h
Normal file
55
wii/libogc/include/netif/arch/sys_arch.h
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_GC_H__
|
||||
#define __SYS_GC_H__
|
||||
|
||||
#include <lwp.h>
|
||||
#include <message.h>
|
||||
#include <mutex.h>
|
||||
#include <cond.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
#define SYS_MBOX_NULL MQ_BOX_NULL
|
||||
#define SYS_SEM_NULL LWP_SEM_NULL
|
||||
|
||||
typedef sem_t sys_sem;
|
||||
typedef sem_t *sys_sem_t;
|
||||
|
||||
typedef mqbox_t sys_mbox;
|
||||
typedef mqbox_t *sys_mbox_t;
|
||||
|
||||
typedef lwp_t sys_thread;
|
||||
typedef lwp_t* sys_thread_t;
|
||||
|
||||
#endif /* __SYS_C64_H__ */
|
126
wii/libogc/include/netif/etharp.h
Normal file
126
wii/libogc/include/netif/etharp.h
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
||||
* Copyright (c) 2003-2004 Leon Woestenberg <leon.woestenberg@axon.tv>
|
||||
* Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __NETIF_ETHARP_H__
|
||||
#define __NETIF_ETHARP_H__
|
||||
|
||||
#ifndef ETH_PAD_SIZE
|
||||
#define ETH_PAD_SIZE 0
|
||||
#endif
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/ip.h"
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct eth_addr {
|
||||
PACK_STRUCT_FIELD(u8_t addr[6]);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct eth_hdr {
|
||||
#if ETH_PAD_SIZE
|
||||
PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]);
|
||||
#endif
|
||||
PACK_STRUCT_FIELD(struct eth_addr dest);
|
||||
PACK_STRUCT_FIELD(struct eth_addr src);
|
||||
PACK_STRUCT_FIELD(u16_t type);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
/** the ARP message */
|
||||
struct etharp_hdr {
|
||||
PACK_STRUCT_FIELD(struct eth_hdr ethhdr);
|
||||
PACK_STRUCT_FIELD(u16_t hwtype);
|
||||
PACK_STRUCT_FIELD(u16_t proto);
|
||||
PACK_STRUCT_FIELD(u16_t _hwlen_protolen);
|
||||
PACK_STRUCT_FIELD(u16_t opcode);
|
||||
PACK_STRUCT_FIELD(struct eth_addr shwaddr);
|
||||
PACK_STRUCT_FIELD(struct ip_addr2 sipaddr);
|
||||
PACK_STRUCT_FIELD(struct eth_addr dhwaddr);
|
||||
PACK_STRUCT_FIELD(struct ip_addr2 dipaddr);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct ethip_hdr {
|
||||
PACK_STRUCT_FIELD(struct eth_hdr eth);
|
||||
PACK_STRUCT_FIELD(struct ip_hdr ip);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
/** 5 seconds period */
|
||||
#define ARP_TMR_INTERVAL 5000
|
||||
|
||||
#define ETHTYPE_ARP 0x0806
|
||||
#define ETHTYPE_IP 0x0800
|
||||
|
||||
void etharp_init(void);
|
||||
void etharp_tmr(void);
|
||||
void etharp_ip_input(struct netif *netif, struct pbuf *p);
|
||||
void etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr,
|
||||
struct pbuf *p);
|
||||
err_t etharp_output(struct netif *netif, struct ip_addr *ipaddr,
|
||||
struct pbuf *q);
|
||||
err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q);
|
||||
err_t etharp_request(struct netif *netif, struct ip_addr *ipaddr);
|
||||
|
||||
#endif /* __NETIF_ARP_H__ */
|
45
wii/libogc/include/netif/gcif/gcif.h
Normal file
45
wii/libogc/include/netif/gcif/gcif.h
Normal file
@ -0,0 +1,45 @@
|
||||
#ifndef __GCIF_H__
|
||||
#define __GCIF_H__
|
||||
|
||||
#include <lwip/netif.h>
|
||||
|
||||
#define ERR_NODATA -12
|
||||
#define ERR_ALLREAD -13
|
||||
#define ERR_TXERROR -14
|
||||
#define ERR_RXERROR -14
|
||||
#define ERR_NODEV -16
|
||||
#define ERR_PKTSIZE -17
|
||||
#define ERR_TXPENDING -18
|
||||
|
||||
#define cpu_to_be16(x) (x)
|
||||
#define cpu_to_be32(x) (x)
|
||||
static inline u16 cpu_to_le16(u16 x) { return (x<<8) | (x>>8);}
|
||||
static inline u32 cpu_to_le32(u32 x) { return((x>>24) | ((x>>8)&0xff00) | ((x<<8)&0xff0000) | (x<<24));}
|
||||
|
||||
#define cpu_to_le16p(addr) (cpu_to_le16(*(addr)))
|
||||
#define cpu_to_le32p(addr) (cpu_to_le32(*(addr)))
|
||||
#define cpu_to_be16p(addr) (cpu_to_be16(*(addr)))
|
||||
#define cpu_to_be32p(addr) (cpu_to_be32(*(addr)))
|
||||
|
||||
static inline void cpu_to_le16s(u16 *a) {*a = cpu_to_le16(*a);}
|
||||
static inline void cpu_to_le32s(u32 *a) {*a = cpu_to_le32(*a);}
|
||||
static inline void cpu_to_be16s(u16 *a) {*a = cpu_to_be16(*a);}
|
||||
static inline void cpu_to_be32s(u32 *a) {*a = cpu_to_be32(*a);}
|
||||
|
||||
#define le16_to_cpup(x) cpu_to_le16p(x)
|
||||
#define le32_to_cpup(x) cpu_to_le32p(x)
|
||||
#define be16_to_cpup(x) cpu_to_be16p(x)
|
||||
#define be32_to_cpup(x) cpu_to_be32p(x)
|
||||
|
||||
#define le16_to_cpus(x) cpu_to_le16s(x)
|
||||
#define le32_to_cpus(x) cpu_to_le32s(x)
|
||||
#define be16_to_cpus(x) cpu_to_be16s(x)
|
||||
#define be32_to_cpus(x) cpu_to_be32s(x)
|
||||
|
||||
typedef void* dev_s;
|
||||
|
||||
dev_s bba_create(struct netif *);
|
||||
err_t bba_init(struct netif *);
|
||||
void bba_process(struct pbuf *p,struct netif *dev);
|
||||
|
||||
#endif
|
39
wii/libogc/include/netif/loopif.h
Normal file
39
wii/libogc/include/netif/loopif.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __NETIF_LOOPIF_H__
|
||||
#define __NETIF_LOOPIF_H__
|
||||
|
||||
#include "lwip/netif.h"
|
||||
|
||||
err_t loopif_init(struct netif *netif);
|
||||
|
||||
#endif /* __NETIF_LOOPIF_H__ */
|
@ -1,18 +1,18 @@
|
||||
#ifndef __CARD_BUF_H__
|
||||
#define __CARD_BUF_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void sdgecko_initBufferPool();
|
||||
u8* sdgecko_allocBuffer();
|
||||
void sdgecko_freeBuffer(u8 *buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifndef __CARD_BUF_H__
|
||||
#define __CARD_BUF_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void sdgecko_initBufferPool();
|
||||
u8* sdgecko_allocBuffer();
|
||||
void sdgecko_freeBuffer(u8 *buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,65 +1,65 @@
|
||||
#ifndef __CARD_CMN_H__
|
||||
#define __CARD_CMN_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define CARDIO_ERROR_READY 0
|
||||
#define CARDIO_ERROR_BUSY -1
|
||||
#define CARDIO_ERROR_WRONGDEVICE -2
|
||||
#define CARDIO_ERROR_NOCARD -3
|
||||
#define CARDIO_ERROR_IDLE -4
|
||||
#define CARDIO_ERROR_IOERROR -5
|
||||
#define CARDIO_ERROR_IOTIMEOUT -6
|
||||
|
||||
#define CARDIO_ERROR_NOTPERMITTED -107
|
||||
#define CARDIO_ERROR_ROOTENTRY -108
|
||||
#define CARDIO_ERROR_OUTOFROOTENTRY -109
|
||||
#define CARDIO_ERROR_FILEEXIST -110
|
||||
#define CARDIO_ERROR_NOEMPTYCLUSTER -111
|
||||
#define CARDIO_ERROR_EOF -112
|
||||
#define CARDIO_ERROR_SYSTEMPARAM -113
|
||||
#define CARDIO_ERROR_FILEOPENED -114
|
||||
#define CARDIO_ERROR_FILENOTOPENED -115
|
||||
#define CARDIO_ERROR_FILENAMETOOLONG -116
|
||||
#define CARDIO_ERROR_INVALIDNAME -117
|
||||
#define CARDIO_ERROR_NOLONGNAME -118
|
||||
#define CARDIO_ERROR_INCORRECTFAT -119
|
||||
#define CARDIO_ERROR_NOTFOUND -120
|
||||
#define CARDIO_ERROR_OUTOFMEMORY -121
|
||||
#define CARDIO_ERROR_INVALIDFAT -122
|
||||
#define CARDIO_ERROR_INVALIDMBR -123
|
||||
#define CARDIO_ERROR_INVALIDPBR -124
|
||||
#define CARDIO_ERROR_NOEMPTYBLOCK -125
|
||||
#define CARDIO_ERROR_INTERNAL -126
|
||||
#define CARDIO_ERROR_INVALIDPARAM -127
|
||||
#define CARDIO_ERROR_FATALERROR -128
|
||||
|
||||
#define MAX_DRIVE 2
|
||||
#define SECTOR_SIZE 512
|
||||
|
||||
#define NOT_INITIALIZED 0
|
||||
#define INITIALIZING 1
|
||||
#define INITIALIZED 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _dev_info {
|
||||
u32 CpV;
|
||||
u32 HpC;
|
||||
u32 SpH;
|
||||
u32 allS;
|
||||
u32 szS;
|
||||
u32 PBpV;
|
||||
u32 LBpV;
|
||||
u32 SpB;
|
||||
u32 PpB;
|
||||
u32 szP;
|
||||
} DEV_INFO;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
#ifndef __CARD_CMN_H__
|
||||
#define __CARD_CMN_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define CARDIO_ERROR_READY 0
|
||||
#define CARDIO_ERROR_BUSY -1
|
||||
#define CARDIO_ERROR_WRONGDEVICE -2
|
||||
#define CARDIO_ERROR_NOCARD -3
|
||||
#define CARDIO_ERROR_IDLE -4
|
||||
#define CARDIO_ERROR_IOERROR -5
|
||||
#define CARDIO_ERROR_IOTIMEOUT -6
|
||||
|
||||
#define CARDIO_ERROR_NOTPERMITTED -107
|
||||
#define CARDIO_ERROR_ROOTENTRY -108
|
||||
#define CARDIO_ERROR_OUTOFROOTENTRY -109
|
||||
#define CARDIO_ERROR_FILEEXIST -110
|
||||
#define CARDIO_ERROR_NOEMPTYCLUSTER -111
|
||||
#define CARDIO_ERROR_EOF -112
|
||||
#define CARDIO_ERROR_SYSTEMPARAM -113
|
||||
#define CARDIO_ERROR_FILEOPENED -114
|
||||
#define CARDIO_ERROR_FILENOTOPENED -115
|
||||
#define CARDIO_ERROR_FILENAMETOOLONG -116
|
||||
#define CARDIO_ERROR_INVALIDNAME -117
|
||||
#define CARDIO_ERROR_NOLONGNAME -118
|
||||
#define CARDIO_ERROR_INCORRECTFAT -119
|
||||
#define CARDIO_ERROR_NOTFOUND -120
|
||||
#define CARDIO_ERROR_OUTOFMEMORY -121
|
||||
#define CARDIO_ERROR_INVALIDFAT -122
|
||||
#define CARDIO_ERROR_INVALIDMBR -123
|
||||
#define CARDIO_ERROR_INVALIDPBR -124
|
||||
#define CARDIO_ERROR_NOEMPTYBLOCK -125
|
||||
#define CARDIO_ERROR_INTERNAL -126
|
||||
#define CARDIO_ERROR_INVALIDPARAM -127
|
||||
#define CARDIO_ERROR_FATALERROR -128
|
||||
|
||||
#define MAX_DRIVE 2
|
||||
#define SECTOR_SIZE 512
|
||||
|
||||
#define NOT_INITIALIZED 0
|
||||
#define INITIALIZING 1
|
||||
#define INITIALIZED 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _dev_info {
|
||||
u32 CpV;
|
||||
u32 HpC;
|
||||
u32 SpH;
|
||||
u32 allS;
|
||||
u32 szS;
|
||||
u32 PBpV;
|
||||
u32 LBpV;
|
||||
u32 SpB;
|
||||
u32 PpB;
|
||||
u32 szP;
|
||||
} DEV_INFO;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
@ -1,51 +1,51 @@
|
||||
#ifndef __CARD_IO_H__
|
||||
#define __CARD_IO_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define MAX_MI_NUM 1
|
||||
#define MAX_DI_NUM 5
|
||||
|
||||
#define PAGE_SIZE256 256
|
||||
#define PAGE_SIZE512 512
|
||||
|
||||
/* CID Register */
|
||||
#define MANUFACTURER_ID(drv_no) ((u8)(g_CID[drv_no][0]))
|
||||
|
||||
/* CSD Register */
|
||||
#define READ_BL_LEN(drv_no) ((u8)(g_CSD[drv_no][5]&0x0f))
|
||||
#define WRITE_BL_LEN(drv_no) ((u8)((g_CSD[drv_no][12]&0x03)<<2)|((g_CSD[drv_no][13]>>6)&0x03))
|
||||
#define C_SIZE(drv_no) ((u16)(((g_CSD[drv_no][6]&0x03)<<10)|(g_CSD[drv_no][7]<<2)|((g_CSD[drv_no][8]>>6)&0x03)))
|
||||
#define C_SIZE_MULT(drv_no) ((u8)((g_CSD[drv_no][9]&0x03)<<1)|((g_CSD[drv_no][10]>>7)&0x01))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern u8 g_CSD[MAX_DRIVE][16];
|
||||
extern u8 g_CID[MAX_DRIVE][16];
|
||||
extern u8 g_mCode[MAX_MI_NUM];
|
||||
extern u16 g_dCode[MAX_MI_NUM][MAX_DI_NUM];
|
||||
|
||||
|
||||
void sdgecko_initIODefault();
|
||||
s32 sdgecko_initIO(s32 drv_no);
|
||||
s32 sdgecko_preIO(s32 drv_no);
|
||||
s32 sdgecko_readCID(s32 drv_no);
|
||||
s32 sdgecko_readCSD(s32 drv_no);
|
||||
s32 sdgecko_readStatus(s32 drv_no);
|
||||
s32 sdgecko_readSectors(s32 drv_no,u32 sector_no,u32 num_sectors,void *buf);
|
||||
s32 sdgecko_writeSector(s32 drv_no,u32 sector_no,const void *buf,u32 len);
|
||||
s32 sdgecko_writeSectors(s32 drv_no,u32 sector_no,u32 num_sectors,const void *buf);
|
||||
|
||||
s32 sdgecko_doUnmount(s32 drv_no);
|
||||
|
||||
void sdgecko_insertedCB(s32 drv_no);
|
||||
void sdgecko_ejectedCB(s32 drv_no);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
#ifndef __CARD_IO_H__
|
||||
#define __CARD_IO_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define MAX_MI_NUM 1
|
||||
#define MAX_DI_NUM 5
|
||||
|
||||
#define PAGE_SIZE256 256
|
||||
#define PAGE_SIZE512 512
|
||||
|
||||
/* CID Register */
|
||||
#define MANUFACTURER_ID(drv_no) ((u8)(g_CID[drv_no][0]))
|
||||
|
||||
/* CSD Register */
|
||||
#define READ_BL_LEN(drv_no) ((u8)(g_CSD[drv_no][5]&0x0f))
|
||||
#define WRITE_BL_LEN(drv_no) ((u8)((g_CSD[drv_no][12]&0x03)<<2)|((g_CSD[drv_no][13]>>6)&0x03))
|
||||
#define C_SIZE(drv_no) ((u16)(((g_CSD[drv_no][6]&0x03)<<10)|(g_CSD[drv_no][7]<<2)|((g_CSD[drv_no][8]>>6)&0x03)))
|
||||
#define C_SIZE_MULT(drv_no) ((u8)((g_CSD[drv_no][9]&0x03)<<1)|((g_CSD[drv_no][10]>>7)&0x01))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern u8 g_CSD[MAX_DRIVE][16];
|
||||
extern u8 g_CID[MAX_DRIVE][16];
|
||||
extern u8 g_mCode[MAX_MI_NUM];
|
||||
extern u16 g_dCode[MAX_MI_NUM][MAX_DI_NUM];
|
||||
|
||||
|
||||
void sdgecko_initIODefault();
|
||||
s32 sdgecko_initIO(s32 drv_no);
|
||||
s32 sdgecko_preIO(s32 drv_no);
|
||||
s32 sdgecko_readCID(s32 drv_no);
|
||||
s32 sdgecko_readCSD(s32 drv_no);
|
||||
s32 sdgecko_readStatus(s32 drv_no);
|
||||
s32 sdgecko_readSectors(s32 drv_no,u32 sector_no,u32 num_sectors,void *buf);
|
||||
s32 sdgecko_writeSector(s32 drv_no,u32 sector_no,const void *buf,u32 len);
|
||||
s32 sdgecko_writeSectors(s32 drv_no,u32 sector_no,u32 num_sectors,const void *buf);
|
||||
|
||||
s32 sdgecko_doUnmount(s32 drv_no);
|
||||
|
||||
void sdgecko_insertedCB(s32 drv_no);
|
||||
void sdgecko_ejectedCB(s32 drv_no);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
@ -1,45 +1,45 @@
|
||||
/*
|
||||
|
||||
gcsd.h
|
||||
|
||||
Hardware routines for reading and writing to SD geckos connected
|
||||
to the memory card ports.
|
||||
|
||||
These functions are just wrappers around libsdcard's functions.
|
||||
|
||||
Copyright (c) 2008 Sven "svpe" Peter <svpe@gmx.net>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __GCSD_H__
|
||||
#define __GCSD_H__
|
||||
|
||||
#include <gccore.h>
|
||||
#include <ogc/disc_io.h>
|
||||
|
||||
#define DEVICE_TYPE_GC_SD (('G'<<24)|('C'<<16)|('S'<<8)|'D')
|
||||
|
||||
extern const DISC_INTERFACE __io_gcsda;
|
||||
extern const DISC_INTERFACE __io_gcsdb;
|
||||
|
||||
#endif
|
||||
/*
|
||||
|
||||
gcsd.h
|
||||
|
||||
Hardware routines for reading and writing to SD geckos connected
|
||||
to the memory card ports.
|
||||
|
||||
These functions are just wrappers around libsdcard's functions.
|
||||
|
||||
Copyright (c) 2008 Sven "svpe" Peter <svpe@gmx.net>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __GCSD_H__
|
||||
#define __GCSD_H__
|
||||
|
||||
#include <gccore.h>
|
||||
#include <ogc/disc_io.h>
|
||||
|
||||
#define DEVICE_TYPE_GC_SD (('G'<<24)|('C'<<16)|('S'<<8)|'D')
|
||||
|
||||
extern const DISC_INTERFACE __io_gcsda;
|
||||
extern const DISC_INTERFACE __io_gcsdb;
|
||||
|
||||
#endif
|
||||
|
@ -1,44 +1,44 @@
|
||||
/*
|
||||
|
||||
wii_sd.h
|
||||
|
||||
Hardware interface for libfat Wii internal SD
|
||||
|
||||
Copyright (c) 2008
|
||||
Michael Wiedenbauer (shagkur)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __WIISD_IO_H__
|
||||
#define __WIISD_IO_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
#include <ogc/disc_io.h>
|
||||
|
||||
#define DEVICE_TYPE_WII_SD (('W'<<24)|('I'<<16)|('S'<<8)|'D')
|
||||
|
||||
extern const DISC_INTERFACE __io_wiisd;
|
||||
|
||||
#endif
|
||||
/*
|
||||
|
||||
wii_sd.h
|
||||
|
||||
Hardware interface for libfat Wii internal SD
|
||||
|
||||
Copyright (c) 2008
|
||||
Michael Wiedenbauer (shagkur)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __WIISD_IO_H__
|
||||
#define __WIISD_IO_H__
|
||||
|
||||
#include <gctypes.h>
|
||||
#include <ogc/disc_io.h>
|
||||
|
||||
#define DEVICE_TYPE_WII_SD (('W'<<24)|('I'<<16)|('S'<<8)|'D')
|
||||
|
||||
extern const DISC_INTERFACE __io_wiisd;
|
||||
|
||||
#endif
|
||||
|
92
wii/libogc/include/wiikeyboard/keyboard.h
Normal file
92
wii/libogc/include/wiikeyboard/keyboard.h
Normal file
@ -0,0 +1,92 @@
|
||||
/*-------------------------------------------------------------
|
||||
|
||||
keyboard.h -- keyboard event system
|
||||
|
||||
Copyright (C) 2008, 2009
|
||||
DAVY Guillaume davyg2@gmail.com
|
||||
Brian Johnson brijohn@gmail.com
|
||||
dhewg
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
-------------------------------------------------------------*/
|
||||
|
||||
#ifndef __KEYBOARD_H__
|
||||
#define __KEYBOARD_H__
|
||||
|
||||
#include "wsksymdef.h"
|
||||
|
||||
#define MOD_SHIFT_L (1 << 0)
|
||||
#define MOD_SHIFT_R (1 << 1)
|
||||
#define MOD_SHIFTLOCK (1 << 2)
|
||||
#define MOD_CAPSLOCK (1 << 3)
|
||||
#define MOD_CONTROL_L (1 << 4)
|
||||
#define MOD_CONTROL_R (1 << 5)
|
||||
#define MOD_META_L (1 << 6)
|
||||
#define MOD_META_R (1 << 7)
|
||||
#define MOD_MODESHIFT (1 << 8)
|
||||
#define MOD_NUMLOCK (1 << 9)
|
||||
#define MOD_COMPOSE (1 << 10)
|
||||
#define MOD_HOLDSCREEN (1 << 11)
|
||||
#define MOD_COMMAND (1 << 12)
|
||||
#define MOD_COMMAND1 (1 << 13)
|
||||
#define MOD_COMMAND2 (1 << 14)
|
||||
#define MOD_MODELOCK (1 << 15)
|
||||
|
||||
#define MOD_ANYSHIFT (MOD_SHIFT_L | MOD_SHIFT_R | MOD_SHIFTLOCK)
|
||||
#define MOD_ANYCONTROL (MOD_CONTROL_L | MOD_CONTROL_R)
|
||||
#define MOD_ANYMETA (MOD_META_L | MOD_META_R)
|
||||
|
||||
#define MOD_ONESET(val, mask) (((val) & (mask)) != 0)
|
||||
#define MOD_ALLSET(val, mask) (((val) & (mask)) == (mask))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef enum {
|
||||
KEYBOARD_CONNECTED,
|
||||
KEYBOARD_DISCONNECTED,
|
||||
KEYBOARD_PRESSED,
|
||||
KEYBOARD_RELEASED
|
||||
} keyboard_event_type;
|
||||
|
||||
typedef struct {
|
||||
keyboard_event_type type;
|
||||
u16 modifiers;
|
||||
u8 keycode;
|
||||
u16 symbol;
|
||||
} keyboard_event;
|
||||
|
||||
typedef void (*keyPressCallback)(char symbol);
|
||||
|
||||
s32 KEYBOARD_Init(keyPressCallback keypress_cb);
|
||||
s32 KEYBOARD_Deinit(void);
|
||||
|
||||
s32 KEYBOARD_GetEvent(keyboard_event *event);
|
||||
s32 KEYBOARD_FlushEvents(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __KEYBOARD_H__ */
|
||||
|
76
wii/libogc/include/wiikeyboard/usbkeyboard.h
Normal file
76
wii/libogc/include/wiikeyboard/usbkeyboard.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*-------------------------------------------------------------
|
||||
|
||||
usbkeyboard.h -- Usb keyboard support(boot protocol)
|
||||
|
||||
Copyright (C) 2008, 2009
|
||||
DAVY Guillaume davyg2@gmail.com
|
||||
dhewg
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
-------------------------------------------------------------*/
|
||||
|
||||
#ifndef __USBKEYBOARD_H__
|
||||
#define __USBKEYBOARD_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
USBKEYBOARD_PRESSED = 0,
|
||||
USBKEYBOARD_RELEASED,
|
||||
USBKEYBOARD_DISCONNECTED
|
||||
} USBKeyboard_eventType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
USBKEYBOARD_LEDNUM = 0,
|
||||
USBKEYBOARD_LEDCAPS,
|
||||
USBKEYBOARD_LEDSCROLL
|
||||
} USBKeyboard_led;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
USBKeyboard_eventType type;
|
||||
u8 keyCode;
|
||||
} USBKeyboard_event;
|
||||
|
||||
typedef void (*eventcallback) (USBKeyboard_event event);
|
||||
|
||||
s32 USBKeyboard_Initialize(void);
|
||||
s32 USBKeyboard_Deinitialize(void);
|
||||
|
||||
s32 USBKeyboard_Open(const eventcallback cb);
|
||||
void USBKeyboard_Close(void);
|
||||
|
||||
bool USBKeyboard_IsConnected(void);
|
||||
s32 USBKeyboard_Scan(void);
|
||||
|
||||
s32 USBKeyboard_SetLed(const USBKeyboard_led led, bool on);
|
||||
s32 USBKeyboard_ToggleLed(const USBKeyboard_led led);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __USBKEYBOARD_H__ */
|
||||
|
776
wii/libogc/include/wiikeyboard/wsksymdef.h
Normal file
776
wii/libogc/include/wiikeyboard/wsksymdef.h
Normal file
@ -0,0 +1,776 @@
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Juergen Hannken-Illjes.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _DEV_WSCONS_WSKSYMDEF_H_
|
||||
#define _DEV_WSCONS_WSKSYMDEF_H_
|
||||
|
||||
/*
|
||||
* Keysymbols encoded as 16-bit Unicode. Special symbols
|
||||
* are encoded in the private area (0xe000 - 0xf8ff).
|
||||
* Currently only ISO Latin-1 subset is supported.
|
||||
*
|
||||
* This file is parsed from userland. Encode keysyms as:
|
||||
*
|
||||
* #define KS_[^ \t]* 0x[0-9a-f]*
|
||||
*
|
||||
* and don't modify the border comments.
|
||||
*/
|
||||
|
||||
/*BEGINKEYSYMDECL*/
|
||||
|
||||
/*
|
||||
* Group Ascii (ISO Latin1) character in low byte
|
||||
*/
|
||||
|
||||
#define KS_BackSpace 0x08
|
||||
#define KS_Tab 0x09
|
||||
#define KS_Linefeed 0x0a
|
||||
#define KS_Clear 0x0b
|
||||
#define KS_Return 0x0d
|
||||
#define KS_Escape 0x1b
|
||||
#define KS_space 0x20
|
||||
#define KS_exclam 0x21
|
||||
#define KS_quotedbl 0x22
|
||||
#define KS_numbersign 0x23
|
||||
#define KS_dollar 0x24
|
||||
#define KS_percent 0x25
|
||||
#define KS_ampersand 0x26
|
||||
#define KS_apostrophe 0x27
|
||||
#define KS_parenleft 0x28
|
||||
#define KS_parenright 0x29
|
||||
#define KS_asterisk 0x2a
|
||||
#define KS_plus 0x2b
|
||||
#define KS_comma 0x2c
|
||||
#define KS_minus 0x2d
|
||||
#define KS_period 0x2e
|
||||
#define KS_slash 0x2f
|
||||
#define KS_0 0x30
|
||||
#define KS_1 0x31
|
||||
#define KS_2 0x32
|
||||
#define KS_3 0x33
|
||||
#define KS_4 0x34
|
||||
#define KS_5 0x35
|
||||
#define KS_6 0x36
|
||||
#define KS_7 0x37
|
||||
#define KS_8 0x38
|
||||
#define KS_9 0x39
|
||||
#define KS_colon 0x3a
|
||||
#define KS_semicolon 0x3b
|
||||
#define KS_less 0x3c
|
||||
#define KS_equal 0x3d
|
||||
#define KS_greater 0x3e
|
||||
#define KS_question 0x3f
|
||||
#define KS_at 0x40
|
||||
#define KS_A 0x41
|
||||
#define KS_B 0x42
|
||||
#define KS_C 0x43
|
||||
#define KS_D 0x44
|
||||
#define KS_E 0x45
|
||||
#define KS_F 0x46
|
||||
#define KS_G 0x47
|
||||
#define KS_H 0x48
|
||||
#define KS_I 0x49
|
||||
#define KS_J 0x4a
|
||||
#define KS_K 0x4b
|
||||
#define KS_L 0x4c
|
||||
#define KS_M 0x4d
|
||||
#define KS_N 0x4e
|
||||
#define KS_O 0x4f
|
||||
#define KS_P 0x50
|
||||
#define KS_Q 0x51
|
||||
#define KS_R 0x52
|
||||
#define KS_S 0x53
|
||||
#define KS_T 0x54
|
||||
#define KS_U 0x55
|
||||
#define KS_V 0x56
|
||||
#define KS_W 0x57
|
||||
#define KS_X 0x58
|
||||
#define KS_Y 0x59
|
||||
#define KS_Z 0x5a
|
||||
#define KS_bracketleft 0x5b
|
||||
#define KS_backslash 0x5c
|
||||
#define KS_bracketright 0x5d
|
||||
#define KS_asciicircum 0x5e
|
||||
#define KS_underscore 0x5f
|
||||
#define KS_grave 0x60
|
||||
#define KS_a 0x61
|
||||
#define KS_b 0x62
|
||||
#define KS_c 0x63
|
||||
#define KS_d 0x64
|
||||
#define KS_e 0x65
|
||||
#define KS_f 0x66
|
||||
#define KS_g 0x67
|
||||
#define KS_h 0x68
|
||||
#define KS_i 0x69
|
||||
#define KS_j 0x6a
|
||||
#define KS_k 0x6b
|
||||
#define KS_l 0x6c
|
||||
#define KS_m 0x6d
|
||||
#define KS_n 0x6e
|
||||
#define KS_o 0x6f
|
||||
#define KS_p 0x70
|
||||
#define KS_q 0x71
|
||||
#define KS_r 0x72
|
||||
#define KS_s 0x73
|
||||
#define KS_t 0x74
|
||||
#define KS_u 0x75
|
||||
#define KS_v 0x76
|
||||
#define KS_w 0x77
|
||||
#define KS_x 0x78
|
||||
#define KS_y 0x79
|
||||
#define KS_z 0x7a
|
||||
#define KS_braceleft 0x7b
|
||||
#define KS_bar 0x7c
|
||||
#define KS_braceright 0x7d
|
||||
#define KS_asciitilde 0x7e
|
||||
#define KS_Delete 0x7f
|
||||
|
||||
#define KS_nobreakspace 0xa0
|
||||
#define KS_exclamdown 0xa1
|
||||
#define KS_cent 0xa2
|
||||
#define KS_sterling 0xa3
|
||||
#define KS_currency 0xa4
|
||||
#define KS_yen 0xa5
|
||||
#define KS_brokenbar 0xa6
|
||||
#define KS_section 0xa7
|
||||
#define KS_diaeresis 0xa8
|
||||
#define KS_copyright 0xa9
|
||||
#define KS_ordfeminine 0xaa
|
||||
#define KS_guillemotleft 0xab
|
||||
#define KS_notsign 0xac
|
||||
#define KS_hyphen 0xad
|
||||
#define KS_registered 0xae
|
||||
#define KS_macron 0xaf
|
||||
#define KS_degree 0xb0
|
||||
#define KS_plusminus 0xb1
|
||||
#define KS_twosuperior 0xb2
|
||||
#define KS_threesuperior 0xb3
|
||||
#define KS_acute 0xb4
|
||||
#define KS_mu 0xb5
|
||||
#define KS_paragraph 0xb6
|
||||
#define KS_periodcentered 0xb7
|
||||
#define KS_cedilla 0xb8
|
||||
#define KS_onesuperior 0xb9
|
||||
#define KS_masculine 0xba
|
||||
#define KS_guillemotright 0xbb
|
||||
#define KS_onequarter 0xbc
|
||||
#define KS_onehalf 0xbd
|
||||
#define KS_threequarters 0xbe
|
||||
#define KS_questiondown 0xbf
|
||||
#define KS_Agrave 0xc0
|
||||
#define KS_Aacute 0xc1
|
||||
#define KS_Acircumflex 0xc2
|
||||
#define KS_Atilde 0xc3
|
||||
#define KS_Adiaeresis 0xc4
|
||||
#define KS_Aring 0xc5
|
||||
#define KS_AE 0xc6
|
||||
#define KS_Ccedilla 0xc7
|
||||
#define KS_Egrave 0xc8
|
||||
#define KS_Eacute 0xc9
|
||||
#define KS_Ecircumflex 0xca
|
||||
#define KS_Ediaeresis 0xcb
|
||||
#define KS_Igrave 0xcc
|
||||
#define KS_Iacute 0xcd
|
||||
#define KS_Icircumflex 0xce
|
||||
#define KS_Idiaeresis 0xcf
|
||||
#define KS_ETH 0xd0
|
||||
#define KS_Ntilde 0xd1
|
||||
#define KS_Ograve 0xd2
|
||||
#define KS_Oacute 0xd3
|
||||
#define KS_Ocircumflex 0xd4
|
||||
#define KS_Otilde 0xd5
|
||||
#define KS_Odiaeresis 0xd6
|
||||
#define KS_multiply 0xd7
|
||||
#define KS_Ooblique 0xd8
|
||||
#define KS_Ugrave 0xd9
|
||||
#define KS_Uacute 0xda
|
||||
#define KS_Ucircumflex 0xdb
|
||||
#define KS_Udiaeresis 0xdc
|
||||
#define KS_Yacute 0xdd
|
||||
#define KS_THORN 0xde
|
||||
#define KS_ssharp 0xdf
|
||||
#define KS_agrave 0xe0
|
||||
#define KS_aacute 0xe1
|
||||
#define KS_acircumflex 0xe2
|
||||
#define KS_atilde 0xe3
|
||||
#define KS_adiaeresis 0xe4
|
||||
#define KS_aring 0xe5
|
||||
#define KS_ae 0xe6
|
||||
#define KS_ccedilla 0xe7
|
||||
#define KS_egrave 0xe8
|
||||
#define KS_eacute 0xe9
|
||||
#define KS_ecircumflex 0xea
|
||||
#define KS_ediaeresis 0xeb
|
||||
#define KS_igrave 0xec
|
||||
#define KS_iacute 0xed
|
||||
#define KS_icircumflex 0xee
|
||||
#define KS_idiaeresis 0xef
|
||||
#define KS_eth 0xf0
|
||||
#define KS_ntilde 0xf1
|
||||
#define KS_ograve 0xf2
|
||||
#define KS_oacute 0xf3
|
||||
#define KS_ocircumflex 0xf4
|
||||
#define KS_otilde 0xf5
|
||||
#define KS_odiaeresis 0xf6
|
||||
#define KS_division 0xf7
|
||||
#define KS_oslash 0xf8
|
||||
#define KS_ugrave 0xf9
|
||||
#define KS_uacute 0xfa
|
||||
#define KS_ucircumflex 0xfb
|
||||
#define KS_udiaeresis 0xfc
|
||||
#define KS_yacute 0xfd
|
||||
#define KS_thorn 0xfe
|
||||
#define KS_ydiaeresis 0xff
|
||||
|
||||
#define KS_Odoubleacute 0x150
|
||||
#define KS_odoubleacute 0x151
|
||||
#define KS_Udoubleacute 0x170
|
||||
#define KS_udoubleacute 0x171
|
||||
|
||||
/*
|
||||
* Group Dead (dead accents)
|
||||
*/
|
||||
|
||||
#define KS_dead_grave 0x0300
|
||||
#define KS_dead_acute 0x0301
|
||||
#define KS_dead_circumflex 0x0302
|
||||
#define KS_dead_tilde 0x0303
|
||||
#define KS_dead_diaeresis 0x0308
|
||||
#define KS_dead_abovering 0x030a
|
||||
#define KS_dead_cedilla 0x0327
|
||||
|
||||
/*
|
||||
* Group Cyrillic (koi8-r)
|
||||
*/
|
||||
|
||||
#define KS_Cyrillic_A 0xe1
|
||||
#define KS_Cyrillic_BE 0xe2
|
||||
#define KS_Cyrillic_VE 0xf7
|
||||
#define KS_Cyrillic_GE 0xe7
|
||||
#define KS_Cyrillic_DE 0xe4
|
||||
#define KS_Cyrillic_IE 0xe5
|
||||
#define KS_Cyrillic_YO 0xb3
|
||||
#define KS_Cyrillic_ZHE 0xf6
|
||||
#define KS_Cyrillic_ZE 0xfa
|
||||
#define KS_Cyrillic_I 0xe9
|
||||
#define KS_Cyrillic_ISHORT 0xea
|
||||
#define KS_Cyrillic_IUKR 0xb6
|
||||
#define KS_Cyrillic_YI 0xb7
|
||||
#define KS_Cyrillic_KA 0xeb
|
||||
#define KS_Cyrillic_EL 0xec
|
||||
#define KS_Cyrillic_EM 0xed
|
||||
#define KS_Cyrillic_EN 0xee
|
||||
#define KS_Cyrillic_O 0xef
|
||||
#define KS_Cyrillic_PE 0xf0
|
||||
#define KS_Cyrillic_ER 0xf2
|
||||
#define KS_Cyrillic_ES 0xf3
|
||||
#define KS_Cyrillic_TE 0xf4
|
||||
#define KS_Cyrillic_U 0xf5
|
||||
#define KS_Cyrillic_EF 0xe6
|
||||
#define KS_Cyrillic_HA 0xe8
|
||||
#define KS_Cyrillic_TSE 0xe3
|
||||
#define KS_Cyrillic_CHE 0xfe
|
||||
#define KS_Cyrillic_SHA 0xfb
|
||||
#define KS_Cyrillic_SCHA 0xfd
|
||||
#define KS_Cyrillic_HSIGHN 0xff
|
||||
#define KS_Cyrillic_YERU 0xf9
|
||||
#define KS_Cyrillic_SSIGHN 0xf8
|
||||
#define KS_Cyrillic_E 0xfc
|
||||
#define KS_Cyrillic_YU 0xe0
|
||||
#define KS_Cyrillic_YA 0xf1
|
||||
#define KS_Cyrillic_a 0xc1
|
||||
#define KS_Cyrillic_be 0xc2
|
||||
#define KS_Cyrillic_ve 0xd7
|
||||
#define KS_Cyrillic_ge 0xc7
|
||||
#define KS_Cyrillic_de 0xc4
|
||||
#define KS_Cyrillic_ie 0xc5
|
||||
#define KS_Cyrillic_yo 0xa3
|
||||
#define KS_Cyrillic_zhe 0xd6
|
||||
#define KS_Cyrillic_ze 0xda
|
||||
#define KS_Cyrillic_i 0xc9
|
||||
#define KS_Cyrillic_ishort 0xca
|
||||
#define KS_Cyrillic_iukr 0xa6
|
||||
#define KS_Cyrillic_yi 0xa7
|
||||
#define KS_Cyrillic_ka 0xcb
|
||||
#define KS_Cyrillic_el 0xcc
|
||||
#define KS_Cyrillic_em 0xcd
|
||||
#define KS_Cyrillic_en 0xce
|
||||
#define KS_Cyrillic_o 0xcf
|
||||
#define KS_Cyrillic_pe 0xd0
|
||||
#define KS_Cyrillic_er 0xd2
|
||||
#define KS_Cyrillic_es 0xd3
|
||||
#define KS_Cyrillic_te 0xd4
|
||||
#define KS_Cyrillic_u 0xd5
|
||||
#define KS_Cyrillic_ef 0xc6
|
||||
#define KS_Cyrillic_ha 0xc8
|
||||
#define KS_Cyrillic_tse 0xc3
|
||||
#define KS_Cyrillic_che 0xde
|
||||
#define KS_Cyrillic_sha 0xdb
|
||||
#define KS_Cyrillic_scha 0xdd
|
||||
#define KS_Cyrillic_hsighn 0xdf
|
||||
#define KS_Cyrillic_yeru 0xd9
|
||||
#define KS_Cyrillic_ssighn 0xd8
|
||||
#define KS_Cyrillic_e 0xdc
|
||||
#define KS_Cyrillic_yu 0xc0
|
||||
#define KS_Cyrillic_ya 0xd1
|
||||
#define KS_Cyrillic_gheukr 0xad
|
||||
#define KS_Cyrillic_GHEUKR 0xbd
|
||||
#define KS_Cyrillic_yeukr 0xa4
|
||||
#define KS_Cyrillic_YEUKR 0xb4
|
||||
|
||||
/*
|
||||
* Group Latin-2 (iso8859-2)
|
||||
*/
|
||||
|
||||
#define KS_L2_Aogonek 0xa1
|
||||
#define KS_L2_breve 0xa2
|
||||
#define KS_L2_Lstroke 0xa3
|
||||
#define KS_L2_Lcaron 0xa5
|
||||
#define KS_L2_Sacute 0xa6
|
||||
#define KS_L2_Scaron 0xa9
|
||||
#define KS_L2_Scedilla 0xaa
|
||||
#define KS_L2_Tcaron 0xab
|
||||
#define KS_L2_Zacute 0xac
|
||||
#define KS_L2_Zcaron 0xae
|
||||
#define KS_L2_Zdotabove 0xaf
|
||||
#define KS_L2_aogonek 0xb1
|
||||
#define KS_L2_ogonek 0xb2
|
||||
#define KS_L2_lstroke 0xb3
|
||||
#define KS_L2_lcaron 0xb5
|
||||
#define KS_L2_sacute 0xb6
|
||||
#define KS_L2_caron 0xb7
|
||||
#define KS_L2_scaron 0xb9
|
||||
#define KS_L2_scedilla 0xba
|
||||
#define KS_L2_tcaron 0xbb
|
||||
#define KS_L2_zacute 0xbc
|
||||
#define KS_L2_dblacute 0xbd
|
||||
#define KS_L2_zcaron 0xbe
|
||||
#define KS_L2_zdotabove 0xbf
|
||||
#define KS_L2_Racute 0xc0
|
||||
#define KS_L2_Abreve 0xc3
|
||||
#define KS_L2_Lacute 0xc5
|
||||
#define KS_L2_Cacute 0xc6
|
||||
#define KS_L2_Ccaron 0xc8
|
||||
#define KS_L2_Eogonek 0xca
|
||||
#define KS_L2_Ecaron 0xcc
|
||||
#define KS_L2_Dcaron 0xcf
|
||||
#define KS_L2_Dstroke 0xd0
|
||||
#define KS_L2_Nacute 0xd1
|
||||
#define KS_L2_Ncaron 0xd2
|
||||
#define KS_L2_Odoubleacute 0xd5
|
||||
#define KS_L2_Rcaron 0xd8
|
||||
#define KS_L2_Uring 0xd9
|
||||
#define KS_L2_Udoubleacute 0xdb
|
||||
#define KS_L2_Tcedilla 0xde
|
||||
#define KS_L2_racute 0xe0
|
||||
#define KS_L2_abreve 0xe3
|
||||
#define KS_L2_lacute 0xe5
|
||||
#define KS_L2_cacute 0xe6
|
||||
#define KS_L2_ccaron 0xe8
|
||||
#define KS_L2_eogonek 0xea
|
||||
#define KS_L2_ecaron 0xec
|
||||
#define KS_L2_dcaron 0xef
|
||||
#define KS_L2_dstroke 0xf0
|
||||
#define KS_L2_nacute 0xf1
|
||||
#define KS_L2_odoubleacute 0xf5
|
||||
#define KS_L2_rcaron 0xf8
|
||||
#define KS_L2_uring 0xf9
|
||||
#define KS_L2_udoubleacute 0xfb
|
||||
#define KS_L2_tcedilla 0xfe
|
||||
#define KS_L2_dotabove 0xff
|
||||
|
||||
/*
|
||||
* Group Latin-5 (iso8859-9)
|
||||
*/
|
||||
|
||||
#define KS_L5_Gbreve 0xd0
|
||||
#define KS_L5_Idotabove 0xdd
|
||||
#define KS_L5_Scedilla 0xde
|
||||
#define KS_L5_gbreve 0xf0
|
||||
#define KS_L5_idotless 0xfd
|
||||
#define KS_L5_scedilla 0xfe
|
||||
|
||||
/*
|
||||
* Group Latin-7 (iso8859-13)
|
||||
*/
|
||||
|
||||
#define KS_L7_rightdblquot 0xa1
|
||||
#define KS_L7_dbllow9quot 0xa5
|
||||
#define KS_L7_Ostroke 0xa8
|
||||
#define KS_L7_Rcedilla 0xaa
|
||||
#define KS_L7_AE 0xaf
|
||||
#define KS_L7_leftdblquot 0xb4
|
||||
#define KS_L7_ostroke 0xb8
|
||||
#define KS_L7_rcedilla 0xba
|
||||
#define KS_L7_ae 0xbf
|
||||
#define KS_L7_Aogonek 0xc0
|
||||
#define KS_L7_Iogonek 0xc1
|
||||
#define KS_L7_Amacron 0xc2
|
||||
#define KS_L7_Cacute 0xc3
|
||||
#define KS_L7_Eogonek 0xc6
|
||||
#define KS_L7_Emacron 0xc7
|
||||
#define KS_L7_Ccaron 0xc8
|
||||
#define KS_L7_Zacute 0xca
|
||||
#define KS_L7_Edot 0xcb
|
||||
#define KS_L7_Gcedilla 0xcc
|
||||
#define KS_L7_Kcedilla 0xcd
|
||||
#define KS_L7_Imacron 0xce
|
||||
#define KS_L7_Lcedilla 0xcf
|
||||
#define KS_L7_Scaron 0xd0
|
||||
#define KS_L7_Nacute 0xd1
|
||||
#define KS_L7_Ncedilla 0xd2
|
||||
#define KS_L7_Omacron 0xd4
|
||||
#define KS_L7_Uogonek 0xd8
|
||||
#define KS_L7_Lstroke 0xd9
|
||||
#define KS_L7_Sacute 0xda
|
||||
#define KS_L7_Umacron 0xdb
|
||||
#define KS_L7_Zdot 0xdd
|
||||
#define KS_L7_Zcaron 0xde
|
||||
#define KS_L7_aogonek 0xe0
|
||||
#define KS_L7_iogonek 0xe1
|
||||
#define KS_L7_amacron 0xe2
|
||||
#define KS_L7_cacute 0xe3
|
||||
#define KS_L7_eogonek 0xe6
|
||||
#define KS_L7_emacron 0xe7
|
||||
#define KS_L7_ccaron 0xe8
|
||||
#define KS_L7_zacute 0xea
|
||||
#define KS_L7_edot 0xeb
|
||||
#define KS_L7_gcedilla 0xec
|
||||
#define KS_L7_kcedilla 0xed
|
||||
#define KS_L7_imacron 0xee
|
||||
#define KS_L7_lcedilla 0xef
|
||||
#define KS_L7_scaron 0xf0
|
||||
#define KS_L7_nacute 0xf1
|
||||
#define KS_L7_ncedilla 0xf2
|
||||
#define KS_L7_omacron 0xf4
|
||||
#define KS_L7_uogonek 0xf8
|
||||
#define KS_L7_lstroke 0xf9
|
||||
#define KS_L7_sacute 0xfa
|
||||
#define KS_L7_umacron 0xfb
|
||||
#define KS_L7_zdot 0xfd
|
||||
#define KS_L7_zcaron 0xfe
|
||||
#define KS_L7_rightsnglquot 0xff
|
||||
|
||||
/*
|
||||
* Group 1 (modifiers)
|
||||
*/
|
||||
|
||||
#define KS_Shift_L 0xf101
|
||||
#define KS_Shift_R 0xf102
|
||||
#define KS_Control_L 0xf103
|
||||
#define KS_Control_R 0xf104
|
||||
#define KS_Caps_Lock 0xf105
|
||||
#define KS_Shift_Lock 0xf106
|
||||
#define KS_Alt_L 0xf107
|
||||
#define KS_Alt_R 0xf108
|
||||
#define KS_Multi_key 0xf109
|
||||
#define KS_Mode_switch 0xf10a
|
||||
#define KS_Num_Lock 0xf10b
|
||||
#define KS_Hold_Screen 0xf10c
|
||||
#define KS_Cmd 0xf10d
|
||||
#define KS_Cmd1 0xf10e
|
||||
#define KS_Cmd2 0xf10f
|
||||
#define KS_Meta_L 0xf110
|
||||
#define KS_Meta_R 0xf111
|
||||
#define KS_Zenkaku_Hankaku 0xf112 /* Zenkaku/Hankaku toggle */
|
||||
#define KS_Hiragana_Katakana 0xf113 /* Hiragana/Katakana toggle */
|
||||
#define KS_Henkan_Mode 0xf114 /* Start/Stop Conversion */
|
||||
#define KS_Henkan 0xf115 /* Alias for Henkan_Mode */
|
||||
#define KS_Muhenkan 0xf116 /* Cancel Conversion */
|
||||
#define KS_Mode_Lock 0xf117
|
||||
|
||||
/*
|
||||
* Group 2 (keypad) character in low byte
|
||||
*/
|
||||
|
||||
#define KS_KP_F1 0xf291
|
||||
#define KS_KP_F2 0xf292
|
||||
#define KS_KP_F3 0xf293
|
||||
#define KS_KP_F4 0xf294
|
||||
#define KS_KP_Home 0xf295
|
||||
#define KS_KP_Left 0xf296
|
||||
#define KS_KP_Up 0xf297
|
||||
#define KS_KP_Right 0xf298
|
||||
#define KS_KP_Down 0xf299
|
||||
#define KS_KP_Prior 0xf29a
|
||||
#define KS_KP_Next 0xf29b
|
||||
#define KS_KP_End 0xf29c
|
||||
#define KS_KP_Begin 0xf29d
|
||||
#define KS_KP_Insert 0xf29e
|
||||
#define KS_KP_Delete 0xf29f
|
||||
|
||||
#define KS_KP_Space 0xf220
|
||||
#define KS_KP_Tab 0xf209
|
||||
#define KS_KP_Enter 0xf20d
|
||||
#define KS_KP_Equal 0xf23d
|
||||
#define KS_KP_Numbersign 0xf223
|
||||
#define KS_KP_Multiply 0xf22a
|
||||
#define KS_KP_Add 0xf22b
|
||||
#define KS_KP_Separator 0xf22c
|
||||
#define KS_KP_Subtract 0xf22d
|
||||
#define KS_KP_Decimal 0xf22e
|
||||
#define KS_KP_Divide 0xf22f
|
||||
#define KS_KP_0 0xf230
|
||||
#define KS_KP_1 0xf231
|
||||
#define KS_KP_2 0xf232
|
||||
#define KS_KP_3 0xf233
|
||||
#define KS_KP_4 0xf234
|
||||
#define KS_KP_5 0xf235
|
||||
#define KS_KP_6 0xf236
|
||||
#define KS_KP_7 0xf237
|
||||
#define KS_KP_8 0xf238
|
||||
#define KS_KP_9 0xf239
|
||||
|
||||
/*
|
||||
* Group 3 (function)
|
||||
*/
|
||||
|
||||
#define KS_f1 0xf300
|
||||
#define KS_f2 0xf301
|
||||
#define KS_f3 0xf302
|
||||
#define KS_f4 0xf303
|
||||
#define KS_f5 0xf304
|
||||
#define KS_f6 0xf305
|
||||
#define KS_f7 0xf306
|
||||
#define KS_f8 0xf307
|
||||
#define KS_f9 0xf308
|
||||
#define KS_f10 0xf309
|
||||
#define KS_f11 0xf30a
|
||||
#define KS_f12 0xf30b
|
||||
#define KS_f13 0xf30c
|
||||
#define KS_f14 0xf30d
|
||||
#define KS_f15 0xf30e
|
||||
#define KS_f16 0xf30f
|
||||
#define KS_f17 0xf310
|
||||
#define KS_f18 0xf311
|
||||
#define KS_f19 0xf312
|
||||
#define KS_f20 0xf313
|
||||
|
||||
#define KS_F1 0xf340
|
||||
#define KS_F2 0xf341
|
||||
#define KS_F3 0xf342
|
||||
#define KS_F4 0xf343
|
||||
#define KS_F5 0xf344
|
||||
#define KS_F6 0xf345
|
||||
#define KS_F7 0xf346
|
||||
#define KS_F8 0xf347
|
||||
#define KS_F9 0xf348
|
||||
#define KS_F10 0xf349
|
||||
#define KS_F11 0xf34a
|
||||
#define KS_F12 0xf34b
|
||||
#define KS_F13 0xf34c
|
||||
#define KS_F14 0xf34d
|
||||
#define KS_F15 0xf34e
|
||||
#define KS_F16 0xf34f
|
||||
#define KS_F17 0xf350
|
||||
#define KS_F18 0xf351
|
||||
#define KS_F19 0xf352
|
||||
#define KS_F20 0xf353
|
||||
|
||||
#define KS_Home 0xf381
|
||||
#define KS_Prior 0xf382
|
||||
#define KS_Next 0xf383
|
||||
#define KS_Up 0xf384
|
||||
#define KS_Down 0xf385
|
||||
#define KS_Left 0xf386
|
||||
#define KS_Right 0xf387
|
||||
#define KS_End 0xf388
|
||||
#define KS_Insert 0xf389
|
||||
#define KS_Help 0xf38a
|
||||
#define KS_Execute 0xf38b
|
||||
#define KS_Find 0xf38c
|
||||
#define KS_Select 0xf38d
|
||||
#define KS_Again 0xf38e
|
||||
#define KS_Props 0xf38f
|
||||
#define KS_Undo 0xf390
|
||||
#define KS_Front 0xf391
|
||||
#define KS_Copy 0xf392
|
||||
#define KS_Open 0xf393
|
||||
#define KS_Paste 0xf394
|
||||
#define KS_Cut 0xf395
|
||||
|
||||
#define KS_Menu 0xf3c0
|
||||
#define KS_Pause 0xf3c1
|
||||
#define KS_Print_Screen 0xf3c2
|
||||
|
||||
#define KS_AudioMute 0xf3d1
|
||||
#define KS_AudioLower 0xf3d2
|
||||
#define KS_AudioRaise 0xf3d3
|
||||
|
||||
/*
|
||||
* Group 4 (command)
|
||||
*/
|
||||
|
||||
#define KS_Cmd_Screen0 0xf400
|
||||
#define KS_Cmd_Screen1 0xf401
|
||||
#define KS_Cmd_Screen2 0xf402
|
||||
#define KS_Cmd_Screen3 0xf403
|
||||
#define KS_Cmd_Screen4 0xf404
|
||||
#define KS_Cmd_Screen5 0xf405
|
||||
#define KS_Cmd_Screen6 0xf406
|
||||
#define KS_Cmd_Screen7 0xf407
|
||||
#define KS_Cmd_Screen8 0xf408
|
||||
#define KS_Cmd_Screen9 0xf409
|
||||
#define KS_Cmd_Screen10 0xf40a
|
||||
#define KS_Cmd_Screen11 0xf40b
|
||||
#define KS_Cmd_Debugger 0xf420
|
||||
#define KS_Cmd_ResetEmul 0xf421
|
||||
#define KS_Cmd_ResetClose 0xf422
|
||||
#define KS_Cmd_BacklightOn 0xf423
|
||||
#define KS_Cmd_BacklightOff 0xf424
|
||||
#define KS_Cmd_BacklightToggle 0xf425
|
||||
#define KS_Cmd_BrightnessUp 0xf426
|
||||
#define KS_Cmd_BrightnessDown 0xf427
|
||||
#define KS_Cmd_BrightnessRotate 0xf428
|
||||
#define KS_Cmd_ContrastUp 0xf429
|
||||
#define KS_Cmd_ContrastDown 0xf42a
|
||||
#define KS_Cmd_ContrastRotate 0xf42b
|
||||
#define KS_Cmd_ScrollBack 0xf42c
|
||||
#define KS_Cmd_ScrollFwd 0xf42d
|
||||
#define KS_Cmd_KbdReset 0xf42e
|
||||
|
||||
/*
|
||||
* Group 5 (internal)
|
||||
*/
|
||||
|
||||
#define KS_voidSymbol 0xf500
|
||||
|
||||
/*ENDKEYSYMDECL*/
|
||||
|
||||
/*
|
||||
* keysym groups
|
||||
*/
|
||||
|
||||
#define KS_GROUP_Mod 0xf100
|
||||
#define KS_GROUP_Keypad 0xf200
|
||||
#define KS_GROUP_Function 0xf300
|
||||
#define KS_GROUP_Command 0xf400
|
||||
#define KS_GROUP_Internal 0xf500
|
||||
#define KS_GROUP_Dead 0xf801 /* not encoded in keysym */
|
||||
#define KS_GROUP_Ascii 0xf802 /* not encoded in keysym */
|
||||
#define KS_GROUP_Keycode 0xf803 /* not encoded in keysym */
|
||||
|
||||
#define KS_NUMKEYCODES 0x1000
|
||||
#define KS_KEYCODE(v) ((v) | 0xe000)
|
||||
|
||||
#define KS_GROUP(k) ((k) >= 0x0300 && (k) < 0x0370 ? KS_GROUP_Dead : \
|
||||
(((k) & 0xf000) == 0xe000 ? KS_GROUP_Keycode : \
|
||||
(((k) & 0xf800) == 0xf000 ? ((k) & 0xff00) : \
|
||||
KS_GROUP_Ascii)))
|
||||
|
||||
#define KS_VALUE(k) (((k) & 0xf000) == 0xe000 ? ((k) & 0x0fff) : \
|
||||
(((k) & 0xf800) == 0xf000 ? ((k) & 0x00ff) : (k)))
|
||||
|
||||
/*
|
||||
* Keyboard types: 8bit encoding, 24bit variant
|
||||
*/
|
||||
|
||||
#define KB_ENCODING(e) ((e) & 0x0000ff00)
|
||||
#define KB_VARIANT(e) ((e) & 0xffff00ff)
|
||||
|
||||
#define KB_NONE 0x0000
|
||||
#define KB_USER 0x0100
|
||||
#define KB_US 0x0200
|
||||
#define KB_DE 0x0300
|
||||
#define KB_DK 0x0400
|
||||
#define KB_IT 0x0500
|
||||
#define KB_FR 0x0600
|
||||
#define KB_UK 0x0700
|
||||
#define KB_JP 0x0800
|
||||
#define KB_SV 0x0900
|
||||
#define KB_NO 0x0a00
|
||||
#define KB_ES 0x0b00
|
||||
#define KB_HU 0x0c00
|
||||
#define KB_BE 0x0d00
|
||||
#define KB_RU 0x0e00
|
||||
#define KB_SG 0x0f00
|
||||
#define KB_SF 0x1000
|
||||
#define KB_PT 0x1100
|
||||
#define KB_UA 0x1200
|
||||
#define KB_LT 0x1300
|
||||
#define KB_LA 0x1400
|
||||
#define KB_BR 0x1500
|
||||
#define KB_NL 0x1600
|
||||
#define KB_TR 0x1700
|
||||
#define KB_PL 0x1800
|
||||
#define KB_SI 0x1900
|
||||
#define KB_CF 0x1a00
|
||||
#define KB_LV 0x1b00
|
||||
|
||||
#define KB_NODEAD 0x000001 /* disable dead accents */
|
||||
#define KB_DECLK 0x000002 /* DEC LKnnn layout */
|
||||
#define KB_LK401 0x000004 /* DEC LK401 instead LK201 */
|
||||
#define KB_SWAPCTRLCAPS 0x000008 /* swap Left-Control and Caps-Lock */
|
||||
#define KB_DVORAK 0x000010 /* Dvorak layout */
|
||||
#define KB_METAESC 0x000020 /* generate ESC prefix on ALT-key */
|
||||
#define KB_IOPENER 0x000040 /* f1-f12 -> ESC,f1-f11 */
|
||||
#define KB_MACHDEP 0x000080 /* machine dependent */
|
||||
#define KB_APPLE 0x010000 /* Apple specific layout */
|
||||
|
||||
#define KB_ENCTAB \
|
||||
{ KB_USER, "user" }, \
|
||||
{ KB_US, "us" }, \
|
||||
{ KB_DE, "de" }, \
|
||||
{ KB_DK, "dk" }, \
|
||||
{ KB_IT, "it" }, \
|
||||
{ KB_FR, "fr" }, \
|
||||
{ KB_UK, "uk" }, \
|
||||
{ KB_JP, "jp" }, \
|
||||
{ KB_SV, "sv" }, \
|
||||
{ KB_NO, "no" }, \
|
||||
{ KB_ES, "es" }, \
|
||||
{ KB_HU, "hu" }, \
|
||||
{ KB_BE, "be" }, \
|
||||
{ KB_RU, "ru" }, \
|
||||
{ KB_UA, "ua" }, \
|
||||
{ KB_SG, "sg" }, \
|
||||
{ KB_SF, "sf" }, \
|
||||
{ KB_PT, "pt" }, \
|
||||
{ KB_LT, "lt" }, \
|
||||
{ KB_LA, "la" }, \
|
||||
{ KB_BR, "br" }, \
|
||||
{ KB_NL, "nl" }, \
|
||||
{ KB_TR, "tr" }, \
|
||||
{ KB_PL, "pl" }, \
|
||||
{ KB_SI, "si" }, \
|
||||
{ KB_CF, "cf" }, \
|
||||
{ KB_LV, "lv" }
|
||||
|
||||
#define KB_VARTAB \
|
||||
{ KB_NODEAD, "nodead" }, \
|
||||
{ KB_DECLK, "declk" }, \
|
||||
{ KB_LK401, "lk401" }, \
|
||||
{ KB_SWAPCTRLCAPS, "swapctrlcaps" }, \
|
||||
{ KB_DVORAK, "dvorak" }, \
|
||||
{ KB_METAESC, "metaesc" }, \
|
||||
{ KB_IOPENER, "iopener" }, \
|
||||
{ KB_MACHDEP, "machdep" }, \
|
||||
{ KB_APPLE, "apple" }
|
||||
|
||||
#endif /* !_DEV_WSCONS_WSKSYMDEF_H_ */
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user