⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windows_extra.h

📁 mobile ip 在linux下的一种实现
💻 H
字号:
/* $Id: windows_extra.h,v 1.4 2001/09/02 15:22:31 jm Exp $ * Low level defines of not included features for Windows (cygwin32) * * Dynamic hierarchial IP tunnel * Copyright (C) 2000-2001, Dynamics group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See README and COPYING for * more details. */#ifndef WINDOWS_EXTRA_H#define WINDOWS_EXTRA_H/* temporary solution for replace UNIX local domain socket with UDP for API * calls; FIX: should probably be replaced with something Windows-specific * IPC that could check RO/RW privileges */#define API_UDP_PORT_RO 20001#define API_UDP_PORT_RW 20002struct iphdr  {#if __BYTE_ORDER == __LITTLE_ENDIAN    unsigned int ihl:4;    unsigned int version:4;#elif __BYTE_ORDER == __BIG_ENDIAN    unsigned int version:4;    unsigned int ihl:4;#else# error	"Please fix <bits/endian.h>"#endif    u_int8_t tos;    u_int16_t tot_len;    u_int16_t id;    u_int16_t frag_off;    u_int8_t ttl;    u_int8_t protocol;    u_int16_t check;    u_int32_t saddr;    u_int32_t daddr;    /*The options start here. */  };#define ETH_ALEN	6		/* Octets in one ethernet addr	 */struct ethhdr {	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/	unsigned short	h_proto;		/* packet type ID field	*/};struct icmphdr{  u_int8_t type;		/* message type */  u_int8_t code;		/* type sub-code */  u_int16_t checksum;  union  {    struct    {      u_int16_t	id;      u_int16_t	sequence;    } echo;			/* echo datagram */    u_int32_t	gateway;	/* gateway address */    struct    {      u_int16_t	__unused;      u_int16_t	mtu;    } frag;			/* path mtu discovery */  } un;};#define ICMP_DEST_UNREACH	3	/* Destination Unreachable	*/#define ICMP_NET_UNREACH	0	/* Network Unreachable		*/#define ICMP_HOST_UNREACH	1	/* Host Unreachable		*/#define ICMP_PORT_UNREACH	3	/* Port Unreachable		*/struct udphdr {  u_int16_t	source;  u_int16_t	dest;  u_int16_t	len;  u_int16_t	check;};#define ARPHRD_ETHER 	1		/* Ethernet 10/100Mbps.  *//* temporary solution to get rid of errors with certain defines */#ifndef AF_LOCAL#define AF_LOCAL 1#endif#ifndef SO_PRIORITY#define SO_PRIORITY 12#endif#ifndef timerisset#define timerisset(tvp)	 ((tvp)->tv_sec || (tvp)->tv_usec)#endif#ifndef timerclear#define timerclear(tvp)	 (tvp)->tv_sec = (tvp)->tv_usec = 0#endif#ifndef MAXINT#define MAXINT 2147483647#endif/* these should really be included from windows.h, iptypes.h, iphlpapi.h, * but these include files do not seem to be exactly compatible with others.. */typedef unsigned long DWORD;typedef unsigned int UINT;typedef unsigned long ULONG, *PULONG;typedef long LONG;typedef unsigned char BYTE;typedef wchar_t WCHAR;typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;typedef WINBOOL BOOL;#ifndef ANY_SIZE#define ANY_SIZE 1#endif#define MAX_ADAPTER_NAME 128typedef unsigned long IPAddr, IPMask, IP_STATUS;typedef struct {  ULONG Index;  WCHAR  Name[MAX_ADAPTER_NAME];} IP_ADAPTER_INDEX_MAP, *PIP_ADAPTER_INDEX_MAP;typedef struct {  LONG NumAdapters;  IP_ADAPTER_INDEX_MAP Adapter[ANY_SIZE];} IP_INTERFACE_INFO, *PIP_INTERFACE_INFO;#include <iprtrmib.h>#define NO_ERROR 0L#define ERROR_NOT_SUPPORTED 50L#define ERROR_INVALID_PARAMETER 87L#define WINAPI __stdcallDWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW);DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW);DWORD WINAPI GetInterfaceInfo(PIP_INTERFACE_INFO,PULONG);DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE,PULONG,BOOL);DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW);DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW);DWORD WINAPI GetBestRoute(DWORD,DWORD,PMIB_IPFORWARDROW);DWORD WINAPI SetIpForwardEntry(PMIB_IPFORWARDROW);DWORD WINAPI GetIfEntry(PMIB_IFROW);DWORD WINAPI GetIfTable(PMIB_IFTABLE,PULONG,BOOL);DWORD WINAPI SetIpTTL(UINT);DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE,PULONG,BOOL);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -