PageRenderTime 27ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/recipes/obsolete/iputils/files/remove-glibc-headers.patch

https://github.com/e3c/openembedded
Patch | 944 lines | 943 code | 1 blank | 0 comment | 0 complexity | e7f46a2eaa149494730d705dd6fb073d MD5 | raw file
  1. We are not using the local glibc headers for now.
  2. Remove them to keep them out of the way.
  3. diff -durN orig/include-glibc/bits/socket.h new/include-glibc/bits/socket.h
  4. --- orig/include-glibc/bits/socket.h 2005-11-14 22:37:26.000000000 +1100
  5. +++ new/include-glibc/bits/socket.h 1970-01-01 10:00:00.000000000 +1000
  6. @@ -1,280 +0,0 @@
  7. -/* System-specific socket constants and types. Linux version.
  8. - Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
  9. - This file is part of the GNU C Library.
  10. -
  11. - The GNU C Library is free software; you can redistribute it and/or
  12. - modify it under the terms of the GNU Library General Public License as
  13. - published by the Free Software Foundation; either version 2 of the
  14. - License, or (at your option) any later version.
  15. -
  16. - The GNU C Library is distributed in the hope that it will be useful,
  17. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. - Library General Public License for more details.
  20. -
  21. - You should have received a copy of the GNU Library General Public
  22. - License along with the GNU C Library; see the file COPYING.LIB. If not,
  23. - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  24. - Boston, MA 02111-1307, USA. */
  25. -
  26. -#ifndef _SOCKETBITS_H
  27. -
  28. -#define _SOCKETBITS_H 1
  29. -#include <features.h>
  30. -
  31. -#define __need_size_t
  32. -#define __need_NULL
  33. -#include <stddef.h>
  34. -
  35. -
  36. -__BEGIN_DECLS
  37. -
  38. -/* Type for length arguments in socket calls. */
  39. -#ifndef __socklen_t_defined
  40. -typedef unsigned int socklen_t;
  41. -# define __socklen_t_defined
  42. -#endif
  43. -
  44. -/* Types of sockets. */
  45. -enum __socket_type
  46. -{
  47. -#ifndef __mips__
  48. - SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  49. - byte streams. */
  50. -#define SOCK_STREAM SOCK_STREAM
  51. - SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  52. - of fixed maximum length. */
  53. -#define SOCK_DGRAM SOCK_DGRAM
  54. -#else
  55. - SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
  56. - byte streams. */
  57. -#define SOCK_STREAM SOCK_STREAM
  58. - SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
  59. - of fixed maximum length. */
  60. -#define SOCK_DGRAM SOCK_DGRAM
  61. -#endif
  62. - SOCK_RAW = 3, /* Raw protocol interface. */
  63. -#define SOCK_RAW SOCK_RAW
  64. - SOCK_RDM = 4, /* Reliably-delivered messages. */
  65. -#define SOCK_RDM SOCK_RDM
  66. - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  67. - datagrams of fixed maximum length. */
  68. -#define SOCK_SEQPACKET SOCK_SEQPACKET
  69. - SOCK_PACKET = 10 /* Linux specific way of getting packets
  70. - at the dev level. For writing rarp and
  71. - other similar things on the user level. */
  72. -#define SOCK_PACKET SOCK_PACKET
  73. -};
  74. -
  75. -/* Protocol families. */
  76. -#define PF_UNSPEC 0 /* Unspecified. */
  77. -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
  78. -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
  79. -#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */
  80. -#define PF_INET 2 /* IP protocol family. */
  81. -#define PF_AX25 3 /* Amateur Radio AX.25. */
  82. -#define PF_IPX 4 /* Novell Internet Protocol. */
  83. -#define PF_APPLETALK 5 /* Don't use this. */
  84. -#define PF_NETROM 6 /* Amateur radio NetROM. */
  85. -#define PF_BRIDGE 7 /* Multiprotocol bridge. */
  86. -#define PF_AAL5 8 /* Reserved for Werner's ATM. */
  87. -#define PF_X25 9 /* Reserved for X.25 project. */
  88. -#define PF_INET6 10 /* IP version 6. */
  89. -#define PF_ROSE 11 /* Amateur Radio X.25 PLP */
  90. -#define PF_DECnet 12 /* Reserved for DECnet project */
  91. -#define PF_NETBEUI 13 /* Reserved for 802.2LLC project*/
  92. -#define PF_SECURITY 14 /* Security callback pseudo AF */
  93. -#define PF_KEY 15 /* PF_KEY key management API */
  94. -#define PF_NETLINK 16
  95. -#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD */
  96. -#define PF_PACKET 17 /* Packet family */
  97. -#define PF_MAX 32 /* For now.. */
  98. -
  99. -/* Address families. */
  100. -#define AF_UNSPEC PF_UNSPEC
  101. -#define AF_LOCAL PF_LOCAL
  102. -#define AF_UNIX PF_UNIX
  103. -#define AF_FILE PF_FILE
  104. -#define AF_INET PF_INET
  105. -#define AF_AX25 PF_AX25
  106. -#define AF_IPX PF_IPX
  107. -#define AF_APPLETALK PF_APPLETALK
  108. -#define AF_NETROM PF_NETROM
  109. -#define AF_BRIDGE PF_BRIDGE
  110. -#define AF_AAL5 PF_AAL5
  111. -#define AF_X25 PF_X25
  112. -#define AF_INET6 PF_INET6
  113. -#define AF_ROSE PF_ROSE
  114. -#define AF_DECnet PF_DECnet
  115. -#define AF_NETBEUI PF_NETBEUI
  116. -#define AF_SECURITY PF_SECURITY
  117. -#define pseudo_AF_KEY pseudo_PF_KEY
  118. -#define AF_NETLINK PF_NETLINK
  119. -#define AF_ROUTE PF_ROUTE
  120. -#define AF_PACKET PF_PACKET
  121. -#define AF_MAX PF_MAX
  122. -
  123. -/* Socket level values. Others are defined in the appropriate headers.
  124. -
  125. - XXX These definitions also should go into the appropriate headers as
  126. - far as they are available. */
  127. -#define SOL_IPV6 41
  128. -#define SOL_ICMPV6 58
  129. -#define SOL_RAW 255
  130. -#define SOL_AX25 257
  131. -#define SOL_ATALK 258
  132. -#define SOL_NETROM 259
  133. -#define SOL_ROSE 260
  134. -#define SOL_DECNET 261
  135. -#define SOL_X25 262
  136. -
  137. -/* Maximum queue length specifiable by listen. */
  138. -#define SOMAXCONN 128
  139. -
  140. -/* Get the definition of the macro to define the common sockaddr members. */
  141. -#if __GLIBC_MINOR__ >= 1
  142. -#include <bits/sockaddr.h>
  143. -#else
  144. -#include <sockaddrcom.h>
  145. -#endif
  146. -
  147. -/* Structure describing a generic socket address. */
  148. -struct sockaddr
  149. - {
  150. - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
  151. - char sa_data[14]; /* Address data. */
  152. - };
  153. -
  154. -
  155. -/* Bits in the FLAGS argument to `send', `recv', et al. */
  156. -enum
  157. - {
  158. - MSG_OOB = 0x01, /* Process out-of-band data. */
  159. -#define MSG_OOB MSG_OOB
  160. - MSG_PEEK = 0x02, /* Peek at incoming messages. */
  161. -#define MSG_PEEK MSG_PEEK
  162. - MSG_DONTROUTE = 0x04, /* Don't use local routing. */
  163. -#define MSG_DONTROUTE MSG_DONTROUTE
  164. - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
  165. -#define MSG_CTRUNC MSG_CTRUNC
  166. - MSG_PROBE = 0x10,
  167. -#define MSG_PROBE MSG_PROBE
  168. - MSG_TRUNC = 0x20,
  169. -#define MSG_TRUNC MSG_TRUNC
  170. - MSG_DONTWAIT = 0x40,
  171. -#define MSG_DONTWAIT MSG_DONTWAIT
  172. - MSG_WAITALL = 0x100,
  173. -#define MSG_WAITALL MSG_WAITALL
  174. - MSG_CONFIRM = 0x800,
  175. -#define MSG_CONFIRM MSG_CONFIRM
  176. - MSG_ERRQUEUE = 0x2000,
  177. -#define MSG_ERRQUEUE MSG_ERRQUEUE
  178. - MSG_NOSIGNAL = 0x4000,
  179. -#define MSG_NOSIGNAL MSG_NOSIGNAL
  180. - };
  181. -
  182. -/* Structure describing messages sent by
  183. - `sendmsg' and received by `recvmsg'. */
  184. -struct msghdr
  185. - {
  186. - __ptr_t msg_name; /* Address to send to/receive from. */
  187. - socklen_t msg_namelen; /* Length of address data. */
  188. -
  189. - struct iovec *msg_iov; /* Vector of data to send/receive into. */
  190. - size_t msg_iovlen; /* Number of elements in the vector. */
  191. -
  192. - __ptr_t msg_control; /* Ancillary data (eg BSD filedesc passing). */
  193. - size_t msg_controllen; /* Ancillary data buffer length. */
  194. -
  195. - int msg_flags; /* Flags on received message. */
  196. - };
  197. -
  198. -/* Structure used for storage of ancillary data object information. */
  199. -struct cmsghdr
  200. - {
  201. - size_t cmsg_len; /* Length of data in cmsg_data plus length
  202. - of cmsghdr structure. */
  203. - int cmsg_level; /* Originating protocol. */
  204. - int cmsg_type; /* Protocol specific type. */
  205. -#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
  206. - unsigned char __cmsg_data[0]; /* Ancillary data. */
  207. -#endif
  208. - };
  209. -
  210. -/* Ancillary data object manipulation macros. */
  211. -#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
  212. -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
  213. -#else
  214. -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
  215. -#endif
  216. -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
  217. -#define CMSG_FIRSTHDR(mhdr) \
  218. - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
  219. - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
  220. -#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
  221. -#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
  222. -#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
  223. -
  224. -
  225. -#ifndef _EXTERN_INLINE
  226. -# define _EXTERN_INLINE extern __inline
  227. -#endif
  228. -extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr,
  229. - struct cmsghdr *__cmsg));
  230. -_EXTERN_INLINE struct cmsghdr *
  231. -__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
  232. -{
  233. - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
  234. - /* The kernel header does this so there may be a reason. */
  235. - return NULL;
  236. -
  237. - __cmsg = (struct cmsghdr *)
  238. - ((unsigned char *) __cmsg + CMSG_ALIGN(__cmsg->cmsg_len));
  239. -
  240. - if ( (unsigned char *) (__cmsg + 1) >=
  241. - (unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)
  242. - /* No more entries. */
  243. - return NULL;
  244. - return __cmsg;
  245. -}
  246. -
  247. -/* Socket level message types. This must match the definitions in
  248. - <linux/socket.h>. */
  249. -enum
  250. - {
  251. - SCM_RIGHTS = 0x01, /* Data array contains access rights. */
  252. -#define SCM_RIGHTS SCM_RIGHTS
  253. - SCM_CREDENTIALS = 0x02, /* Data array is `struct ucred'. */
  254. -#define SCM_CREDENTIALS SCM_CREDENTIALS
  255. - };
  256. -
  257. -
  258. -
  259. -/* Get socket manipulation related informations from kernel headers. */
  260. -#ifdef THIS_IS_CRAP
  261. -#ifndef _LINUX_TYPES_H
  262. -# define _LINUX_TYPES_H
  263. -#endif
  264. -#endif
  265. -
  266. -#include <asm/socket.h>
  267. -#include <asm/types.h>
  268. -
  269. -struct ucred
  270. -{
  271. - __u32 pid;
  272. - __u32 uid;
  273. - __u32 gid;
  274. -};
  275. -
  276. -
  277. -/* Structure used to manipulate the SO_LINGER option. */
  278. -struct linger
  279. - {
  280. - int l_onoff; /* Nonzero to linger on close. */
  281. - int l_linger; /* Time to linger. */
  282. - };
  283. -
  284. -__END_DECLS
  285. -
  286. -#endif /* socketbits.h */
  287. diff -durN orig/include-glibc/bits/sockunion.h new/include-glibc/bits/sockunion.h
  288. --- orig/include-glibc/bits/sockunion.h 2005-11-14 22:37:26.000000000 +1100
  289. +++ new/include-glibc/bits/sockunion.h 1970-01-01 10:00:00.000000000 +1000
  290. @@ -1,25 +0,0 @@
  291. -
  292. -/* I cannot describe, how I laughed, when saw, that now sys/socket.h
  293. - includes ALL OF networking include files. 8)8)8)
  294. -
  295. - Bravo! Aah, they forgot sockaddr_ll, sockaddr_pkt and sockaddr_nl...
  296. - Not a big problem, we only start the way to single UNIVERSAL include file:
  297. -
  298. - #include <GNU-Gnu_is_Not_Unix.h>.
  299. -
  300. - Jokes apart, it is full crap. Removed.
  301. - --ANK
  302. -
  303. - */
  304. -
  305. -/* Union of all sockaddr types (required by IPv6 Basic API). This is
  306. - somewhat evil. */
  307. -/* 8)8) Well, ipngwg really does strange things sometimes, but
  308. - not in such extent! It is removed long ago --ANK
  309. - */
  310. -
  311. -union sockaddr_union
  312. - {
  313. - struct sockaddr sa;
  314. - char __maxsize[128];
  315. - };
  316. diff -durN orig/include-glibc/glibc-bugs.h new/include-glibc/glibc-bugs.h
  317. --- orig/include-glibc/glibc-bugs.h 2005-11-14 22:37:26.000000000 +1100
  318. +++ new/include-glibc/glibc-bugs.h 1970-01-01 10:00:00.000000000 +1000
  319. @@ -1,20 +0,0 @@
  320. -#ifndef __GLIBC_BUGS_H__
  321. -#define __GLIBC_BUGS_H__ 1
  322. -
  323. -#include <features.h>
  324. -#include <sys/types.h>
  325. -
  326. -#if defined(__GLIBC__) && __GLIBC__ >= 2
  327. -
  328. -#ifndef __KERNEL_STRICT_NAMES
  329. -#define __KERNEL_STRICT_NAMES 1
  330. -#endif
  331. -
  332. -#include <linux/types.h>
  333. -
  334. -typedef __u16 in_port_t;
  335. -typedef __u32 in_addr_t;
  336. -
  337. -#endif
  338. -
  339. -#endif
  340. diff -durN orig/include-glibc/netinet/in.h new/include-glibc/netinet/in.h
  341. --- orig/include-glibc/netinet/in.h 2005-11-14 22:37:26.000000000 +1100
  342. +++ new/include-glibc/netinet/in.h 1970-01-01 10:00:00.000000000 +1000
  343. @@ -1,11 +0,0 @@
  344. -#ifndef _NETINET_IN_H
  345. -#define _NETINET_IN_H 1
  346. -
  347. -#include "glibc-bugs.h"
  348. -#include <sys/socket.h>
  349. -#include <sys/types.h>
  350. -#include <linux/in.h>
  351. -
  352. -#define SOL_IP 0
  353. -
  354. -#endif /* netinet/in.h */
  355. diff -durN orig/include-glibc/netinet/ip.h new/include-glibc/netinet/ip.h
  356. --- orig/include-glibc/netinet/ip.h 2005-11-14 22:37:26.000000000 +1100
  357. +++ new/include-glibc/netinet/ip.h 1970-01-01 10:00:00.000000000 +1000
  358. @@ -1,98 +0,0 @@
  359. -#ifndef __NETINET_IP_H
  360. -#define __NETINET_IP_H 1
  361. -
  362. -#include <glibc-bugs.h>
  363. -#include <netinet/in.h>
  364. -
  365. -#include <linux/ip.h>
  366. -
  367. -#ifdef __USE_BSD
  368. -/*
  369. - * Copyright (c) 1982, 1986, 1993
  370. - * The Regents of the University of California. All rights reserved.
  371. - *
  372. - * Redistribution and use in source and binary forms, with or without
  373. - * modification, are permitted provided that the following conditions
  374. - * are met:
  375. - * 1. Redistributions of source code must retain the above copyright
  376. - * notice, this list of conditions and the following disclaimer.
  377. - * 2. Redistributions in binary form must reproduce the above copyright
  378. - * notice, this list of conditions and the following disclaimer in the
  379. - * documentation and/or other materials provided with the distribution.
  380. - * 3. All advertising materials mentioning features or use of this software
  381. - * must display the following acknowledgement:
  382. - * This product includes software developed by the University of
  383. - * California, Berkeley and its contributors.
  384. - * 4. Neither the name of the University nor the names of its contributors
  385. - * may be used to endorse or promote products derived from this software
  386. - * without specific prior written permission.
  387. - *
  388. - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  389. - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  390. - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  391. - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  392. - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  393. - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  394. - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  395. - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  396. - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  397. - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  398. - * SUCH DAMAGE.
  399. - *
  400. - * @(#)ip.h 8.1 (Berkeley) 6/10/93
  401. - */
  402. -
  403. -/*
  404. - * Definitions for internet protocol version 4.
  405. - * Per RFC 791, September 1981.
  406. - */
  407. -
  408. -/*
  409. - * Structure of an internet header, naked of options.
  410. - */
  411. -struct ip
  412. - {
  413. -#if __BYTE_ORDER == __LITTLE_ENDIAN
  414. - u_int8_t ip_hl:4; /* header length */
  415. - u_int8_t ip_v:4; /* version */
  416. -#endif
  417. -#if __BYTE_ORDER == __BIG_ENDIAN
  418. - u_int8_t ip_v:4; /* version */
  419. - u_int8_t ip_hl:4; /* header length */
  420. -#endif
  421. - u_int8_t ip_tos; /* type of service */
  422. - u_short ip_len; /* total length */
  423. - u_short ip_id; /* identification */
  424. - u_short ip_off; /* fragment offset field */
  425. -#define IP_RF 0x8000 /* reserved fragment flag */
  426. -#define IP_DF 0x4000 /* dont fragment flag */
  427. -#define IP_MF 0x2000 /* more fragments flag */
  428. -#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
  429. - u_int8_t ip_ttl; /* time to live */
  430. - u_int8_t ip_p; /* protocol */
  431. - u_short ip_sum; /* checksum */
  432. - struct in_addr ip_src, ip_dst; /* source and dest address */
  433. - };
  434. -
  435. -/*
  436. - * Time stamp option structure.
  437. - */
  438. -struct ip_timestamp
  439. - {
  440. - u_int8_t ipt_code; /* IPOPT_TS */
  441. - u_int8_t ipt_len; /* size of structure (variable) */
  442. - u_int8_t ipt_ptr; /* index of current entry */
  443. -#if __BYTE_ORDER == __LITTLE_ENDIAN
  444. - u_int8_t ipt_flg:4; /* flags, see below */
  445. - u_int8_t ipt_oflw:4; /* overflow counter */
  446. -#endif
  447. -#if __BYTE_ORDER == __BIG_ENDIAN
  448. - u_int8_t ipt_oflw:4; /* overflow counter */
  449. - u_int8_t ipt_flg:4; /* flags, see below */
  450. -#endif
  451. - u_int32_t data[9];
  452. - };
  453. -#endif /* __USE_BSD */
  454. -
  455. -
  456. -#endif /* netinet/ip.h */
  457. diff -durN orig/include-glibc/netinet/ip_icmp.h new/include-glibc/netinet/ip_icmp.h
  458. --- orig/include-glibc/netinet/ip_icmp.h 2005-11-14 22:37:26.000000000 +1100
  459. +++ new/include-glibc/netinet/ip_icmp.h 1970-01-01 10:00:00.000000000 +1000
  460. @@ -1,199 +0,0 @@
  461. -#ifndef __NETINET_IP_ICMP_H
  462. -#define __NETINET_IP_ICMP_H 1
  463. -
  464. -
  465. -#include <asm/types.h>
  466. -#include <linux/icmp.h>
  467. -
  468. -#ifdef __USE_BSD
  469. -/*
  470. - * Copyright (c) 1982, 1986, 1993
  471. - * The Regents of the University of California. All rights reserved.
  472. - *
  473. - * Redistribution and use in source and binary forms, with or without
  474. - * modification, are permitted provided that the following conditions
  475. - * are met:
  476. - * 1. Redistributions of source code must retain the above copyright
  477. - * notice, this list of conditions and the following disclaimer.
  478. - * 2. Redistributions in binary form must reproduce the above copyright
  479. - * notice, this list of conditions and the following disclaimer in the
  480. - * documentation and/or other materials provided with the distribution.
  481. - * 3. All advertising materials mentioning features or use of this software
  482. - * must display the following acknowledgement:
  483. - * This product includes software developed by the University of
  484. - * California, Berkeley and its contributors.
  485. - * 4. Neither the name of the University nor the names of its contributors
  486. - * may be used to endorse or promote products derived from this software
  487. - * without specific prior written permission.
  488. - *
  489. - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  490. - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  491. - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  492. - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  493. - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  494. - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  495. - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  496. - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  497. - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  498. - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  499. - * SUCH DAMAGE.
  500. - *
  501. - * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
  502. - */
  503. -
  504. -#include <netinet/in.h>
  505. -#include <netinet/ip.h>
  506. -
  507. -/*
  508. - * Internal of an ICMP Router Advertisement
  509. - */
  510. -struct icmp_ra_addr
  511. -{
  512. - u_int32_t ira_addr;
  513. - u_int32_t ira_preference;
  514. -};
  515. -
  516. -struct icmp
  517. -{
  518. - u_int8_t icmp_type; /* type of message, see below */
  519. - u_int8_t icmp_code; /* type sub code */
  520. - u_int16_t icmp_cksum; /* ones complement checksum of struct */
  521. - union
  522. - {
  523. - u_char ih_pptr; /* ICMP_PARAMPROB */
  524. - struct in_addr ih_gwaddr; /* gateway address */
  525. - struct ih_idseq /* echo datagram */
  526. - {
  527. - u_int16_t icd_id;
  528. - u_int16_t icd_seq;
  529. - } ih_idseq;
  530. - u_int32_t ih_void;
  531. -
  532. - /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
  533. - struct ih_pmtu
  534. - {
  535. - u_int16_t ipm_void;
  536. - u_int16_t ipm_nextmtu;
  537. - } ih_pmtu;
  538. -
  539. - struct ih_rtradv
  540. - {
  541. - u_int8_t irt_num_addrs;
  542. - u_int8_t irt_wpa;
  543. - u_int16_t irt_lifetime;
  544. - } ih_rtradv;
  545. - } icmp_hun;
  546. -#define icmp_pptr icmp_hun.ih_pptr
  547. -#define icmp_gwaddr icmp_hun.ih_gwaddr
  548. -#define icmp_id icmp_hun.ih_idseq.icd_id
  549. -#define icmp_seq icmp_hun.ih_idseq.icd_seq
  550. -#define icmp_void icmp_hun.ih_void
  551. -#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
  552. -#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
  553. -#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
  554. -#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
  555. -#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
  556. - union
  557. - {
  558. - struct
  559. - {
  560. - u_int32_t its_otime;
  561. - u_int32_t its_rtime;
  562. - u_int32_t its_ttime;
  563. - } id_ts;
  564. - struct
  565. - {
  566. - struct ip idi_ip;
  567. - /* options and then 64 bits of data */
  568. - } id_ip;
  569. - struct icmp_ra_addr id_radv;
  570. - u_int32_t id_mask;
  571. - u_int8_t id_data[1];
  572. - } icmp_dun;
  573. -#define icmp_otime icmp_dun.id_ts.its_otime
  574. -#define icmp_rtime icmp_dun.id_ts.its_rtime
  575. -#define icmp_ttime icmp_dun.id_ts.its_ttime
  576. -#define icmp_ip icmp_dun.id_ip.idi_ip
  577. -#define icmp_radv icmp_dun.id_radv
  578. -#define icmp_mask icmp_dun.id_mask
  579. -#define icmp_data icmp_dun.id_data
  580. -};
  581. -
  582. -/*
  583. - * Lower bounds on packet lengths for various types.
  584. - * For the error advice packets must first insure that the
  585. - * packet is large enough to contain the returned ip header.
  586. - * Only then can we do the check to see if 64 bits of packet
  587. - * data have been returned, since we need to check the returned
  588. - * ip header length.
  589. - */
  590. -#define ICMP_MINLEN 8 /* abs minimum */
  591. -#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
  592. -#define ICMP_MASKLEN 12 /* address mask */
  593. -#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
  594. -#ifndef _IP_VHL
  595. -#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
  596. - /* N.B.: must separately check that ip_hl >= 5 */
  597. -#else
  598. -#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
  599. - /* N.B.: must separately check that header length >= 5 */
  600. -#endif
  601. -
  602. -/* Definition of type and code fields. */
  603. -/* defined above: ICMP_ECHOREPLY, ICMP_REDIRECT, ICMP_ECHO */
  604. -#define ICMP_UNREACH 3 /* dest unreachable, codes: */
  605. -#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
  606. -#define ICMP_ROUTERADVERT 9 /* router advertisement */
  607. -#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
  608. -#define ICMP_TIMXCEED 11 /* time exceeded, code: */
  609. -#define ICMP_PARAMPROB 12 /* ip header bad */
  610. -#define ICMP_TSTAMP 13 /* timestamp request */
  611. -#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
  612. -#define ICMP_IREQ 15 /* information request */
  613. -#define ICMP_IREQREPLY 16 /* information reply */
  614. -#define ICMP_MASKREQ 17 /* address mask request */
  615. -#define ICMP_MASKREPLY 18 /* address mask reply */
  616. -
  617. -#define ICMP_MAXTYPE 18
  618. -
  619. -/* UNREACH codes */
  620. -#define ICMP_UNREACH_NET 0 /* bad net */
  621. -#define ICMP_UNREACH_HOST 1 /* bad host */
  622. -#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
  623. -#define ICMP_UNREACH_PORT 3 /* bad port */
  624. -#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
  625. -#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
  626. -#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
  627. -#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
  628. -#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
  629. -#define ICMP_UNREACH_NET_PROHIB 9 /* net denied */
  630. -#define ICMP_UNREACH_HOST_PROHIB 10 /* host denied */
  631. -#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
  632. -#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
  633. -#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
  634. -#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
  635. -#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
  636. -
  637. -/* REDIRECT codes */
  638. -#define ICMP_REDIRECT_NET 0 /* for network */
  639. -#define ICMP_REDIRECT_HOST 1 /* for host */
  640. -#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
  641. -#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
  642. -
  643. -/* TIMEXCEED codes */
  644. -#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
  645. -#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
  646. -
  647. -/* PARAMPROB code */
  648. -#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
  649. -
  650. -#define ICMP_INFOTYPE(type) \
  651. - ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
  652. - (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
  653. - (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
  654. - (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
  655. - (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
  656. -
  657. -#endif /* __USE_BSD */
  658. -
  659. -#endif /* netinet/ip_icmp.h */
  660. diff -durN orig/include-glibc/socketbits.h new/include-glibc/socketbits.h
  661. --- orig/include-glibc/socketbits.h 2005-11-14 22:37:26.000000000 +1100
  662. +++ new/include-glibc/socketbits.h 1970-01-01 10:00:00.000000000 +1000
  663. @@ -1,280 +0,0 @@
  664. -/* System-specific socket constants and types. Linux version.
  665. - Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
  666. - This file is part of the GNU C Library.
  667. -
  668. - The GNU C Library is free software; you can redistribute it and/or
  669. - modify it under the terms of the GNU Library General Public License as
  670. - published by the Free Software Foundation; either version 2 of the
  671. - License, or (at your option) any later version.
  672. -
  673. - The GNU C Library is distributed in the hope that it will be useful,
  674. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  675. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  676. - Library General Public License for more details.
  677. -
  678. - You should have received a copy of the GNU Library General Public
  679. - License along with the GNU C Library; see the file COPYING.LIB. If not,
  680. - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  681. - Boston, MA 02111-1307, USA. */
  682. -
  683. -#ifndef _SOCKETBITS_H
  684. -
  685. -#define _SOCKETBITS_H 1
  686. -#include <features.h>
  687. -
  688. -#define __need_size_t
  689. -#define __need_NULL
  690. -#include <stddef.h>
  691. -
  692. -
  693. -__BEGIN_DECLS
  694. -
  695. -/* Type for length arguments in socket calls. */
  696. -#ifndef __socklen_t_defined
  697. -typedef unsigned int socklen_t;
  698. -# define __socklen_t_defined
  699. -#endif
  700. -
  701. -/* Types of sockets. */
  702. -enum __socket_type
  703. -{
  704. -#ifndef __mips__
  705. - SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  706. - byte streams. */
  707. -#define SOCK_STREAM SOCK_STREAM
  708. - SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  709. - of fixed maximum length. */
  710. -#define SOCK_DGRAM SOCK_DGRAM
  711. -#else
  712. - SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
  713. - byte streams. */
  714. -#define SOCK_STREAM SOCK_STREAM
  715. - SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
  716. - of fixed maximum length. */
  717. -#define SOCK_DGRAM SOCK_DGRAM
  718. -#endif
  719. - SOCK_RAW = 3, /* Raw protocol interface. */
  720. -#define SOCK_RAW SOCK_RAW
  721. - SOCK_RDM = 4, /* Reliably-delivered messages. */
  722. -#define SOCK_RDM SOCK_RDM
  723. - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  724. - datagrams of fixed maximum length. */
  725. -#define SOCK_SEQPACKET SOCK_SEQPACKET
  726. - SOCK_PACKET = 10 /* Linux specific way of getting packets
  727. - at the dev level. For writing rarp and
  728. - other similar things on the user level. */
  729. -#define SOCK_PACKET SOCK_PACKET
  730. -};
  731. -
  732. -/* Protocol families. */
  733. -#define PF_UNSPEC 0 /* Unspecified. */
  734. -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
  735. -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
  736. -#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */
  737. -#define PF_INET 2 /* IP protocol family. */
  738. -#define PF_AX25 3 /* Amateur Radio AX.25. */
  739. -#define PF_IPX 4 /* Novell Internet Protocol. */
  740. -#define PF_APPLETALK 5 /* Don't use this. */
  741. -#define PF_NETROM 6 /* Amateur radio NetROM. */
  742. -#define PF_BRIDGE 7 /* Multiprotocol bridge. */
  743. -#define PF_AAL5 8 /* Reserved for Werner's ATM. */
  744. -#define PF_X25 9 /* Reserved for X.25 project. */
  745. -#define PF_INET6 10 /* IP version 6. */
  746. -#define PF_ROSE 11 /* Amateur Radio X.25 PLP */
  747. -#define PF_DECnet 12 /* Reserved for DECnet project */
  748. -#define PF_NETBEUI 13 /* Reserved for 802.2LLC project*/
  749. -#define PF_SECURITY 14 /* Security callback pseudo AF */
  750. -#define PF_KEY 15 /* PF_KEY key management API */
  751. -#define PF_NETLINK 16
  752. -#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD */
  753. -#define PF_PACKET 17 /* Packet family */
  754. -#define PF_MAX 32 /* For now.. */
  755. -
  756. -/* Address families. */
  757. -#define AF_UNSPEC PF_UNSPEC
  758. -#define AF_LOCAL PF_LOCAL
  759. -#define AF_UNIX PF_UNIX
  760. -#define AF_FILE PF_FILE
  761. -#define AF_INET PF_INET
  762. -#define AF_AX25 PF_AX25
  763. -#define AF_IPX PF_IPX
  764. -#define AF_APPLETALK PF_APPLETALK
  765. -#define AF_NETROM PF_NETROM
  766. -#define AF_BRIDGE PF_BRIDGE
  767. -#define AF_AAL5 PF_AAL5
  768. -#define AF_X25 PF_X25
  769. -#define AF_INET6 PF_INET6
  770. -#define AF_ROSE PF_ROSE
  771. -#define AF_DECnet PF_DECnet
  772. -#define AF_NETBEUI PF_NETBEUI
  773. -#define AF_SECURITY PF_SECURITY
  774. -#define pseudo_AF_KEY pseudo_PF_KEY
  775. -#define AF_NETLINK PF_NETLINK
  776. -#define AF_ROUTE PF_ROUTE
  777. -#define AF_PACKET PF_PACKET
  778. -#define AF_MAX PF_MAX
  779. -
  780. -/* Socket level values. Others are defined in the appropriate headers.
  781. -
  782. - XXX These definitions also should go into the appropriate headers as
  783. - far as they are available. */
  784. -#define SOL_IPV6 41
  785. -#define SOL_ICMPV6 58
  786. -#define SOL_RAW 255
  787. -#define SOL_AX25 257
  788. -#define SOL_ATALK 258
  789. -#define SOL_NETROM 259
  790. -#define SOL_ROSE 260
  791. -#define SOL_DECNET 261
  792. -#define SOL_X25 262
  793. -
  794. -/* Maximum queue length specifiable by listen. */
  795. -#define SOMAXCONN 128
  796. -
  797. -/* Get the definition of the macro to define the common sockaddr members. */
  798. -#if __GLIBC_MINOR__ >= 1
  799. -#include <bits/sockaddr.h>
  800. -#else
  801. -#include <sockaddrcom.h>
  802. -#endif
  803. -
  804. -/* Structure describing a generic socket address. */
  805. -struct sockaddr
  806. - {
  807. - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
  808. - char sa_data[14]; /* Address data. */
  809. - };
  810. -
  811. -
  812. -/* Bits in the FLAGS argument to `send', `recv', et al. */
  813. -enum
  814. - {
  815. - MSG_OOB = 0x01, /* Process out-of-band data. */
  816. -#define MSG_OOB MSG_OOB
  817. - MSG_PEEK = 0x02, /* Peek at incoming messages. */
  818. -#define MSG_PEEK MSG_PEEK
  819. - MSG_DONTROUTE = 0x04, /* Don't use local routing. */
  820. -#define MSG_DONTROUTE MSG_DONTROUTE
  821. - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
  822. -#define MSG_CTRUNC MSG_CTRUNC
  823. - MSG_PROBE = 0x10,
  824. -#define MSG_PROBE MSG_PROBE
  825. - MSG_TRUNC = 0x20,
  826. -#define MSG_TRUNC MSG_TRUNC
  827. - MSG_DONTWAIT = 0x40,
  828. -#define MSG_DONTWAIT MSG_DONTWAIT
  829. - MSG_WAITALL = 0x100,
  830. -#define MSG_WAITALL MSG_WAITALL
  831. - MSG_CONFIRM = 0x800,
  832. -#define MSG_CONFIRM MSG_CONFIRM
  833. - MSG_ERRQUEUE = 0x2000,
  834. -#define MSG_ERRQUEUE MSG_ERRQUEUE
  835. - MSG_NOSIGNAL = 0x4000,
  836. -#define MSG_NOSIGNAL MSG_NOSIGNAL
  837. - };
  838. -
  839. -/* Structure describing messages sent by
  840. - `sendmsg' and received by `recvmsg'. */
  841. -struct msghdr
  842. - {
  843. - __ptr_t msg_name; /* Address to send to/receive from. */
  844. - socklen_t msg_namelen; /* Length of address data. */
  845. -
  846. - struct iovec *msg_iov; /* Vector of data to send/receive into. */
  847. - size_t msg_iovlen; /* Number of elements in the vector. */
  848. -
  849. - __ptr_t msg_control; /* Ancillary data (eg BSD filedesc passing). */
  850. - size_t msg_controllen; /* Ancillary data buffer length. */
  851. -
  852. - int msg_flags; /* Flags on received message. */
  853. - };
  854. -
  855. -/* Structure used for storage of ancillary data object information. */
  856. -struct cmsghdr
  857. - {
  858. - size_t cmsg_len; /* Length of data in cmsg_data plus length
  859. - of cmsghdr structure. */
  860. - int cmsg_level; /* Originating protocol. */
  861. - int cmsg_type; /* Protocol specific type. */
  862. -#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
  863. - unsigned char __cmsg_data[0]; /* Ancillary data. */
  864. -#endif
  865. - };
  866. -
  867. -/* Ancillary data object manipulation macros. */
  868. -#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
  869. -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
  870. -#else
  871. -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
  872. -#endif
  873. -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
  874. -#define CMSG_FIRSTHDR(mhdr) \
  875. - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
  876. - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
  877. -#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
  878. -#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
  879. -#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
  880. -
  881. -
  882. -#ifndef _EXTERN_INLINE
  883. -# define _EXTERN_INLINE extern __inline
  884. -#endif
  885. -extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr,
  886. - struct cmsghdr *__cmsg));
  887. -_EXTERN_INLINE struct cmsghdr *
  888. -__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
  889. -{
  890. - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
  891. - /* The kernel header does this so there may be a reason. */
  892. - return NULL;
  893. -
  894. - __cmsg = (struct cmsghdr *)
  895. - ((unsigned char *) __cmsg + CMSG_ALIGN(__cmsg->cmsg_len));
  896. -
  897. - if ( (unsigned char *) (__cmsg + 1) >=
  898. - (unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)
  899. - /* No more entries. */
  900. - return NULL;
  901. - return __cmsg;
  902. -}
  903. -
  904. -/* Socket level message types. This must match the definitions in
  905. - <linux/socket.h>. */
  906. -enum
  907. - {
  908. - SCM_RIGHTS = 0x01, /* Data array contains access rights. */
  909. -#define SCM_RIGHTS SCM_RIGHTS
  910. - SCM_CREDENTIALS = 0x02, /* Data array is `struct ucred'. */
  911. -#define SCM_CREDENTIALS SCM_CREDENTIALS
  912. - };
  913. -
  914. -
  915. -
  916. -/* Get socket manipulation related informations from kernel headers. */
  917. -#ifdef THIS_IS_CRAP
  918. -#ifndef _LINUX_TYPES_H
  919. -# define _LINUX_TYPES_H
  920. -#endif
  921. -#endif
  922. -
  923. -#include <asm/socket.h>
  924. -#include <asm/types.h>
  925. -
  926. -struct ucred
  927. -{
  928. - __u32 pid;
  929. - __u32 uid;
  930. - __u32 gid;
  931. -};
  932. -
  933. -
  934. -/* Structure used to manipulate the SO_LINGER option. */
  935. -struct linger
  936. - {
  937. - int l_onoff; /* Nonzero to linger on close. */
  938. - int l_linger; /* Time to linger. */
  939. - };
  940. -
  941. -__END_DECLS
  942. -
  943. -#endif /* socketbits.h */