9ff308ee4182cf393773b8b6fe24a92efbc028c6
1 #ifndef _LINUX_SOCKET_H 2 #define _LINUX_SOCKET_H 4 #include <asm/socket.h>/* arch-dependent defines */ 5 #include <linux/sockios.h>/* the SIOCxxx I/O controls */ 6 #include <linux/uio.h>/* iovec support */ 9 unsigned short sa_family
;/* address family, AF_xxx */ 10 char sa_data
[14];/* 14 bytes of protocol address */ 14 int l_onoff
;/* Linger active */ 15 int l_linger
;/* How long to linger for */ 20 void* msg_name
;/* Socket name */ 21 int msg_namelen
;/* Length of name */ 22 struct iovec
* msg_iov
;/* Data blocks */ 23 int msg_iovlen
;/* Number of blocks */ 24 void* msg_accrights
;/* Per protocol magic (eg BSD file descriptor passing) */ 25 int msg_accrightslen
;/* Length of rights list */ 29 #define SOCK_STREAM 1/* stream (connection) socket */ 30 #define SOCK_DGRAM 2/* datagram (conn.less) socket */ 31 #define SOCK_RAW 3/* raw socket */ 32 #define SOCK_RDM 4/* reliably-delivered message */ 33 #define SOCK_SEQPACKET 5/* sequential packet socket */ 34 #define SOCK_PACKET 10/* linux specific way of */ 35 /* getting packets at the dev */ 36 /* level. For writing rarp and */ 37 /* other similar things on the */ 40 /* Supported address families. */ 42 #define AF_UNIX 1/* Unix domain sockets */ 43 #define AF_INET 2/* Internet IP Protocol */ 44 #define AF_AX25 3/* Amateur Radio AX.25 */ 45 #define AF_IPX 4/* Novell IPX */ 46 #define AF_APPLETALK 5/* Appletalk DDP */ 47 #define AF_NETROM 6/* Amateur radio NetROM */ 48 #define AF_BRIDGE 7/* Multiprotocol bridge */ 49 #define AF_AAL5 8/* Reserved for Werner's ATM */ 50 #define AF_X25 9/* Reserved for X.25 project */ 51 #define AF_MAX 12/* For now.. */ 53 /* Protocol families, same as address families. */ 54 #define PF_UNSPEC AF_UNSPEC 55 #define PF_UNIX AF_UNIX 56 #define PF_INET AF_INET 57 #define PF_AX25 AF_AX25 59 #define PF_APPLETALK AF_APPLETALK 60 #define PF_NETROM AF_NETROM 61 #define PF_BRIDGE AF_BRIDGE 62 #define PF_AAL5 AF_AAL5 67 /* Flags we can use with send/ and recv. */ 70 #define MSG_DONTROUTE 4 72 /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */ 77 #define SOL_NETROM 259 83 #define IPTOS_LOWDELAY 0x10 84 #define IPTOS_THROUGHPUT 0x08 85 #define IPTOS_RELIABILITY 0x04 87 #ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF 92 #define IP_MULTICAST_IF 32 93 #define IP_MULTICAST_TTL 33 94 #define IP_MULTICAST_LOOP 34 95 #define IP_ADD_MEMBERSHIP 35 96 #define IP_DROP_MEMBERSHIP 36 99 /* These need to appear somewhere around here */ 100 #define IP_DEFAULT_MULTICAST_TTL 1 101 #define IP_DEFAULT_MULTICAST_LOOP 1 102 #define IP_MAX_MEMBERSHIPS 20 107 /* TCP options - this way around because someone left a set in the c library includes */ 108 #define TCP_NODELAY 1 111 /* The various priorities. */ 112 #define SOPRI_INTERACTIVE 0 113 #define SOPRI_NORMAL 1 114 #define SOPRI_BACKGROUND 2 117 externvoidmemcpy_fromiovec(unsigned char*kdata
,struct iovec
*iov
,int len
); 118 externintverify_iovec(struct msghdr
*m
,struct iovec
*iov
,char*address
,int mode
); 119 externvoidmemcpy_toiovec(struct iovec
*v
,unsigned char*kdata
,int len
); 120 externintmove_addr_to_user(void*kaddr
,int klen
,void*uaddr
,int*ulen
); 121 externintmove_addr_to_kernel(void*uaddr
,int ulen
,void*kaddr
); 123 #endif/* _LINUX_SOCKET_H */