include instead." #endif #if __GNUC_PREREQ(3,3) # define HUGE_VALL (__builtin_huge_vall()) #else # define HUGE_VALL ((long double) HUGE_VAL) #endif /* Copyright (C) 2002, 2003 Manuel Novoa III * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * The GNU C Library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with the GNU C Library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ /* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! * * Besides uClibc, I'm using this code in my libc for elks, which is * a 16-bit environment with a fairly limited compiler. It would make * things much easier for me if this file isn't modified unnecessarily. * In particular, please put any new or replacement functions somewhere * else, and modify the makefile to use your version instead. * Thanks. Manuel * * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */ #ifndef _UCLIBC_LOCALE_H #define _UCLIBC_LOCALE_H /**********************************************************************/ /* uClibc compatibilty stuff */ #ifdef __UCLIBC_HAS_LOCALE__ # undef __LOCALE_C_ONLY #else # define __LOCALE_C_ONLY #endif /**********************************************************************/ #define __NL_ITEM_CATEGORY_SHIFT 8 #define __NL_ITEM_INDEX_MASK 0xff /* TODO: Make sure these agree with the locale mmap file gererator! */ #define __LC_CTYPE 0 #define __LC_NUMERIC 1 #define __LC_MONETARY 2 #define __LC_TIME 3 #define __LC_COLLATE 4 #define __LC_MESSAGES 5 #define __LC_ALL 6 /**********************************************************************/ #ifndef __LOCALE_C_ONLY enum { __ctype_encoding_7_bit, /* C/POSIX */ __ctype_encoding_utf8, /* UTF-8 */ __ctype_encoding_8_bit /* for 8-bit codeset locales */ }; #define LOCALE_STRING_SIZE (2 * __LC_ALL + 2) /* * '#' + 2_per_category + '\0' * {locale row # : 0 = C|POSIX} + 0x8001 * encoded in two chars as (((N+1) >> 8) | 0x80) and ((N+1) & 0xff) * so decode is ((((uint16_t)(*s & 0x7f)) << 8) + s[1]) - 1 * * Note: 0s are not used as they are nul-terminators for strings. * Note: 0xff, 0xff is the encoding for a non-selected locale. * (see setlocale() below). * In particular, C/POSIX locale is '#' + "\x80\x01"}*LC_ALL + nul. */ struct __uclibc_locale_struct; typedef struct __uclibc_locale_struct *__locale_t; #endif /* !defined(__LOCALE_C_ONLY) */ #endif /* _UCLIBC_LOCALE_H */ #include /* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _MATH_H # error "Never use directly; include instead." #endif /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) # define HUGE_VAL (__builtin_huge_val()) #elif __GNUC_PREREQ(2,96) # define HUGE_VAL (__extension__ 0x1.0p2047) #elif defined __GNUC__ # define HUGE_VAL \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ { __l: 0x7ff0000000000000ULL }).__d) #else /* not GCC */ # include typedef union { unsigned char __c[8]; double __d; } __huge_val_t; # if __BYTE_ORDER == __BIG_ENDIAN # define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } # endif # if __BYTE_ORDER == __LITTLE_ENDIAN # define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } # endif static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; # define HUGE_VAL (__huge_val.__d) #endif /* GCC. */ ‡2 ._$ ..ˆ2rwhod.h‰2talkd.hŠ2routed.h‹2ļtimed.h/* * Copyright (c) 1983, 1993 * The Regents of the University of California. 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. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)rwhod.h 8.1 (Berkeley) 6/2/93 */ #ifndef _PROTOCOLS_RWHOD_H #define _PROTOCOLS_RWHOD_H 1 #include /* * rwho protocol packet format. */ struct outmp { char out_line[8]; /* tty name */ char out_name[8]; /* user id */ int32_t out_time; /* time on */ }; struct whod { char wd_vers; /* protocol version # */ char wd_type; /* packet type, see below */ char wd_pad[2]; int wd_sendtime; /* time stamp by sender */ int wd_recvtime; /* time stamp applied by receiver */ char wd_hostname[32]; /* hosts's name */ int wd_loadav[3]; /* load average as in uptime */ int wd_boottime; /* time system booted */ struct whoent { struct outmp we_utmp; /* active tty info */ int we_idle; /* tty idle time */ } wd_we[1024 / sizeof (struct whoent)]; }; #define WHODVERSION 1 #define WHODTYPE_STATUS 1 /* host status */ /* We used to define _PATH_RWHODIR here but it's now in . */ #include #endif /* protocols/rwhod.h */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. 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. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)talkd.h 8.1 (Berkeley) 6/2/93 */ #ifndef _PROTOCOLS_TALKD_H #define _PROTOCOLS_TALKD_H 1 /* * This describes the protocol used by the talk server and clients. * * The talk server acts a repository of invitations, responding to * requests by clients wishing to rendezvous for the purpose of * holding a conversation. In normal operation, a client, the caller, * initiates a rendezvous by sending a CTL_MSG to the server of * type LOOK_UP. This causes the server to search its invitation * tables to check if an invitation currently exists for the caller * (to speak to the callee specified in the message). If the lookup * fails, the caller then sends an ANNOUNCE message causing the server * to broadcast an announcement on the callee's login ports requesting * contact. When the callee responds, the local server uses the * recorded invitation to respond with the appropriate rendezvous * address and the caller and callee client programs establish a * stream connection through which the conversation takes place. */ #include #include /* * Client->server request message format. */ typedef struct { u_char vers; /* protocol version */ u_char type; /* request type, see below */ u_char answer; /* not used */ u_char pad; u_int32_t id_num; /* message id */ struct osockaddr addr; /* old (4.3) style */ struct osockaddr ctl_addr; /* old (4.3) style */ int32_t pid; /* caller's process id */ #define NAME_SIZE 12 char l_name[NAME_SIZE];/* caller's name */ char r_name[NAME_SIZE];/* callee's name */ #define TTY_SIZE 16 char r_tty[TTY_SIZE];/* callee's tty name */ } CTL_MSG; /* * Server->client response message format. */ typedef struct { u_char vers; /* protocol version */ u_char type; /* type of request message, see below */ u_char answer; /* response to request message, see below */ u_char pad; u_int32_t id_num; /* message id */ struct osockaddr addr; /* address for establishing conversation */ } CTL_RESPONSE; #define TALK_VERSION 1 /* protocol version */ /* message type values */ #define LEAVE_INVITE 0 /* leave invitation with server */ #define LOOK_UP 1 /* check for invitation by callee */ #define DELETE 2 /* delete invitation by caller */ #define ANNOUNCE 3 /* announce invitation by caller */ /* answer values */ #define SUCCESS 0 /* operation completed properly */ #define NOT_HERE 1 /* callee not logged in */ #define FAILED 2 /* operation failed for unexplained reason */ #define MACHINE_UNKNOWN 3 /* caller's machine name unknown */ #define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */ #define UNKNOWN_REQUEST 5 /* request has invalid type value */ #define BADVERSION 6 /* request has invalid protocol version */ #define BADADDR 7 /* request has invalid addr value */ #define BADCTLADDR 8 /* request has invalid ctl_addr value */ /* * Operational parameters. */ #define MAX_LIFE 60 /* max time daemon saves invitations */ /* RING_WAIT should be 10's of seconds less than MAX_LIFE */ #define RING_WAIT 30 /* time to wait before resending invitation */ #endif /* protocols/talkd.h */ /*- * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. 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. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)routed.h 8.1 (Berkeley) 6/2/93 */ #ifndef _PROTOCOLS_ROUTED_H #define _PROTOCOLS_ROUTED_H 1 #include /* * Routing Information Protocol * * Derived from Xerox NS Routing Information Protocol * by changing 32-bit net numbers to sockaddr's and * padding stuff to 32-bit boundaries. */ #define RIPVERSION 1 struct netinfo { struct sockaddr rip_dst; /* destination net/host */ int rip_metric; /* cost of route */ }; struct rip { u_char rip_cmd; /* request/response */ u_char rip_vers; /* protocol version # */ u_char rip_res1[2]; /* pad to 32-bit boundary */ union { struct netinfo ru_nets[1]; /* variable length... */ char ru_tracefile[1]; /* ditto ... */ } ripun; #define rip_nets ripun.ru_nets #define rip_tracefile ripun.ru_tracefile }; /* * Packet types. */ #define RIPCMD_REQUEST 1 /* want info */ #define RIPCMD_RESPONSE 2 /* responding to request */ #define RIPCMD_TRACEON 3 /* turn tracing on */ #define RIPCMD_TRACEOFF 4 /* turn it off */ #define RIPCMD_MAX 5 #ifdef RIPCMDS char *ripcmds[RIPCMD_MAX] = { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" }; #endif #define HOPCNT_INFINITY 16 /* per Xerox NS */ #define MAXPACKETSIZE 512 /* max broadcast size */ /* * Timer values used in managing the routing table. * Complete tables are broadcast every SUPPLY_INTERVAL seconds. * If changes occur between updates, dynamic updates containing only changes * may be sent. When these are sent, a timer is set for a random value * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates * are sent until the timer expires. * * Every update of a routing entry forces an entry's timer to be reset. * After EXPIRE_TIME without updates, the entry is marked invalid, * but held onto until GARBAGE_TIME so that others may * see it "be deleted". */ #define TIMER_RATE 30 /* alarm clocks every 30 seconds */ #define SUPPLY_INTERVAL 30 /* time to supply tables */ #define MIN_WAITTIME 2 /* min. interval to broadcast changes */ #define MAX_WAITTIME 5 /* max. time to delay changes */ #define EXPIRE_TIME 180 /* time to mark entry invalid */ #define GARBAGE_TIME 240 /* time to garbage collect */ #endif /* protocols/routed.h */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. 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. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)timed.h 8.1 (Berkeley) 6/2/93 */ #ifndef _PROTOCOLS_TIMED_H #define _PROTOCOLS_TIMED_H 1 #ifdef __UCLIBC_HAS_RPC__ #include #endif /* * Time Synchronization Protocol */ #define TSPVERSION 1 #define ANYADDR NULL struct tsp { u_char tsp_type; u_char tsp_vers; u_short tsp_seq; union { struct timeval tspu_time; char tspu_hopcnt; } tsp_u; char tsp_name[MAXHOSTNAMELEN]; }; #define tsp_time tsp_u.tspu_time #define tsp_hopcnt tsp_u.tspu_hopcnt /* * Command types. */ #define TSP_ANY 0 /* match any types */ #define TSP_ADJTIME 1 /* send adjtime */ #define TSP_ACK 2 /* generic acknowledgement */ #define TSP_MASTERREQ 3 /* ask for master's name */ #define TSP_MASTERACK 4 /* acknowledge master request */ #define TSP_SETTIME 5 /* send network time */ #define TSP_MASTERUP 6 /* inform slaves that master is up */ #define TSP_SLAVEUP 7 /* slave is up but not polled */ #define TSP_ELECTION 8 /* advance candidature for master */ #define TSP_ACCEPT 9 /* support candidature of master */ #define TSP_REFUSE 10 /* reject candidature of master */ #define TSP_CONFLICT 11 /* two or more masters present */ #define TSP_RESOLVE 12 /* masters' conflict resolution */ #define TSP_QUIT 13 /* reject candidature if master is up */ #define TSP_DATE 14 /* reset the time (date command) */ #define TSP_DATEREQ 15 /* remote request to reset the time */ #define TSP_DATEACK 16 /* acknowledge time setting */ #define TSP_TRACEON 17 /* turn tracing on */ #define TSP_TRACEOFF 18 /* turn tracing off */ #define TSP_MSITE 19 /* find out master's site */ #define TSP_MSITEREQ 20 /* remote master's site request */ #define TSP_TEST 21 /* for testing election algo */ #define TSP_SETDATE 22 /* New from date command */ #define TSP_SETDATEREQ 23 /* New remote for above */ #define TSP_LOOP 24 /* loop detection packet */ #define TSPTYPENUMBER 25 #ifdef TSPTYPES char *tsptype[TSPTYPENUMBER] = { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP", "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT", "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ", "TEST", "SETDATE", "SETDATEREQ", "LOOP" }; #endif #endif /* protocols/timed.h */ Œ2 ._$ ..2čpacket.h/* Definitions for use with Linux AF_PACKET sockets. Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef __NETPACKET_PACKET_H #define __NETPACKET_PACKET_H 1 struct sockaddr_ll { unsigned short int sll_family; unsigned short int sll_protocol; int sll_ifindex; unsigned short int sll_hatype; unsigned char sll_pkttype; unsigned char sll_halen; unsigned char sll_addr[8]; }; /* Packet types. */ #define PACKET_HOST 0 /* To us. */ #define PACKET_BROADCAST 1 /* To all. */ #define PACKET_MULTICAST 2 /* To group. */ #define PACKET_OTHERHOST 3 /* To someone else. */ #define PACKET_OUTGOING 4 /* Originated by us . */ #define PACKET_LOOPBACK 5 #define PACKET_FASTROUTE 6 /* Packet socket options. */ #define PACKET_ADD_MEMBERSHIP 1 #define PACKET_DROP_MEMBERSHIP 2 #define PACKET_RECV_OUTPUT 3 #define PACKET_RX_RING 5 #define PACKET_STATISTICS 6 struct packet_mreq { int mr_ifindex; unsigned short int mr_type; unsigned short int mr_alen; unsigned char mr_address[8]; }; #define PACKET_MR_MULTICAST 0 #define PACKET_MR_PROMISC 1 #define PACKET_MR_ALLMULTI 2 #endif /* netpacket/packet.h */ Ž2 ._$ ..2čec.h/* Definitions for use with Linux AF_ECONET sockets. Copyright (C) 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _NETECONET_EC_H #define _NETECONET_EC_H 1 #include #include struct ec_addr { unsigned char station; /* Station number. */ unsigned char net; /* Network number. */ }; struct sockaddr_ec { __SOCKADDR_COMMON (sec_); unsigned char port; /* Port number. */ unsigned char cb; /* Control/flag byte. */ unsigned char type; /* Type of message. */ struct ec_addr addr; unsigned long cookie; }; #define ECTYPE_PACKET_RECEIVED 0 /* Packet received */ #define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed */ #define ECTYPE_TRANSMIT_OK 1 #define ECTYPE_TRANSMIT_NOT_LISTENING 2 #define ECTYPE_TRANSMIT_NET_ERROR 3 #define ECTYPE_TRANSMIT_NO_CLOCK 4 #define ECTYPE_TRANSMIT_LINE_JAMMED 5 #define ECTYPE_TRANSMIT_NOT_PRESENT 6 #endif 2 ._$ ..‘2čax25.h/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _NETAX25_AX25_H #define _NETAX25_AX25_H 1 #include #include /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */ #define SOL_AX25 257 /* AX.25 flags: */ #define AX25_WINDOW 1 #define AX25_T1 2 #define AX25_T2 5 #define AX25_T3 4 #define AX25_N2 3 #define AX25_BACKOFF 6 #define AX25_EXTSEQ 7 #define AX25_PIDINCL 8 #define AX25_IDLE 9 #define AX25_PACLEN 10 #define AX25_IPMAXQUEUE 11 #define AX25_IAMDIGI 12 #define AX25_KILL 99 /* AX.25 socket ioctls: */ #define SIOCAX25GETUID (SIOCPROTOPRIVATE) #define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1) #define SIOCAX25DELUID (SIOCPROTOPRIVATE+2) #define SIOCAX25NOUID (SIOCPROTOPRIVATE+3) #define SIOCAX25BPQADDR (SIOCPROTOPRIVATE+4) #define SIOCAX25GETPARMS (SIOCPROTOPRIVATE+5) #define SIOCAX25SETPARMS (SIOCPROTOPRIVATE+6) #define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7) #define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8) #define SIOCAX25GETINFO (SIOCPROTOPRIVATE+9) #define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10) #define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11) /* unknown: */ #define AX25_NOUID_DEFAULT 0 #define AX25_NOUID_BLOCK 1 #define AX25_SET_RT_IPMODE 2 /* Digipeating flags: */ #define AX25_DIGI_INBAND 0x01 /* Allow digipeating within port */ #define AX25_DIGI_XBAND 0x02 /* Allow digipeating across ports */ /* Maximim number of digipeaters: */ #define AX25_MAX_DIGIS 8 typedef struct { char ax25_call[7]; /* 6 call + SSID (shifted ascii) */ } ax25_address; struct sockaddr_ax25 { sa_family_t sax25_family; ax25_address sax25_call; int sax25_ndigis; }; /* * The sockaddr struct with the digipeater adresses: */ struct full_sockaddr_ax25 { struct sockaddr_ax25 fsa_ax25; ax25_address fsa_digipeater[AX25_MAX_DIGIS]; }; #define sax25_uid sax25_ndigis struct ax25_routes_struct { ax25_address port_addr; ax25_address dest_addr; unsigned char digi_count; ax25_address digi_addr[AX25_MAX_DIGIS]; }; /* The AX.25 ioctl structure: */ struct ax25_ctl_struct { ax25_address port_addr; ax25_address source_addr; ax25_address dest_addr; unsigned int cmd; unsigned long arg; unsigned char digi_count; ax25_address digi_addr[AX25_MAX_DIGIS]; }; struct ax25_info_struct { unsigned int n2, n2count; unsigned int t1, t1timer; unsigned int t2, t2timer; unsigned int t3, t3timer; unsigned int idle, idletimer; unsigned int state; unsigned int rcv_q, snd_q; }; struct ax25_fwd_struct { ax25_address port_from; ax25_address port_to; }; /* AX.25 route structure: */ struct ax25_route_opt_struct { ax25_address port_addr; ax25_address dest_addr; int cmd; int arg; }; /* AX.25 BPQ stuff: */ struct ax25_bpqaddr_struct { char dev[16]; ax25_address addr; }; /* Definitions for the AX.25 `values' fields: */ #define AX25_VALUES_IPDEFMODE 0 /* 'D'=DG 'V'=VC */ #define AX25_VALUES_AXDEFMODE 1 /* 8=Normal 128=Extended Seq Nos */ #define AX25_VALUES_NETROM 2 /* Allow NET/ROM - 0=No 1=Yes */ #define AX25_VALUES_TEXT 3 /* Allow PID=Text - 0=No 1=Yes */ #define AX25_VALUES_BACKOFF 4 /* 'E'=Exponential 'L'=Linear */ #define AX25_VALUES_CONMODE 5 /* Allow connected modes - 0=No 1=Yes */ #define AX25_VALUES_WINDOW 6 /* Default window size for standard AX.25 */ #define AX25_VALUES_EWINDOW 7 /* Default window size for extended AX.25 */ #define AX25_VALUES_T1 8 /* Default T1 timeout value */ #define AX25_VALUES_T2 9 /* Default T2 timeout value */ #define AX25_VALUES_T3 10 /* Default T3 timeout value */ #define AX25_VALUES_N2 11 /* Default N2 value */ #define AX25_VALUES_DIGI 12 /* Digipeat mode */ #define AX25_VALUES_IDLE 13 /* mode vc idle timer */ #define AX25_VALUES_PACLEN 14 /* AX.25 MTU */ #define AX25_VALUES_IPMAXQUEUE 15 /* Maximum number of buffers enqueued */ #define AX25_MAX_VALUES 20 struct ax25_parms_struct { ax25_address port_addr; unsigned short values[AX25_MAX_VALUES]; }; #endif /* netax25/ax25.h */ ’2 ._$ ..“2 nameser.h”2inet.h•2tftp.h–2ftp.h—2nameser_compat.h˜2Œtelnet.h/* * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. 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. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. */ /* * Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * $BINDId: nameser.h,v 8.37 2000/03/30 21:16:49 vixie Exp $ */ #ifndef _ARPA_NAMESER_H_ #define _ARPA_NAMESER_H_ #define BIND_4_COMPAT #include #if (!defined(BSD)) || (BSD < 199306) # include #else # include #endif #include /* * Revision information. This is the release date in YYYYMMDD format. * It can change every day so the right thing to do with it is use it * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not * compare for equality; rather, use it to determine whether your libbind.a * contains a new enough lib/nameser/ to support the feature you need. */ #define __NAMESER 19991006 /* New interface version stamp. */ /* * Define constants based on RFC 883, RFC 1034, RFC 1035 */ #define NS_PACKETSZ 512 /* maximum packet size */ #define NS_MAXDNAME 1025 /* maximum domain name */ #define NS_MAXCDNAME 255 /* maximum compressed domain name */ #define NS_MAXLABEL 63 /* maximum length of domain label */ #define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ #define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ #define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ #define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */ #define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */ #define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */ #define NS_INADDRSZ 4 /* IPv4 T_A */ #define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */ #define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ #define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ /* * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord() * in synch with it. */ typedef enum __ns_sect { ns_s_qd = 0, /* Query: Question. */ ns_s_zn = 0, /* Update: Zone. */ ns_s_an = 1, /* Query: Answer. */ ns_s_pr = 1, /* Update: Prerequisites. */ ns_s_ns = 2, /* Query: Name servers. */ ns_s_ud = 2, /* Update: Update. */ ns_s_ar = 3, /* Query|Update: Additional records. */ ns_s_max = 4 } ns_sect; /* * This is a message handle. It is caller allocated and has no dynamic data. * This structure is intended to be opaque to all but ns_parse.c, thus the * leading _'s on the member names. Use the accessor functions, not the _'s. */ typedef struct __ns_msg { const u_char *_msg, *_eom; u_int16_t _id, _flags, _counts[ns_s_max]; const u_char *_sections[ns_s_max]; ns_sect _sect; int _rrnum; const u_char *_ptr; } ns_msg; /* Private data structure - do not use from outside library. */ struct _ns_flagdata { int mask, shift; }; extern struct _ns_flagdata _ns_flagdata[]; /* Accessor macros - this is part of the public interface. */ #define ns_msg_getflag(handle, flag) ( \ ((handle)._flags & _ns_flagdata[flag].mask) \ >> _ns_flagdata[flag].shift \ ) #define ns_msg_id(handle) ((handle)._id + 0) #define ns_msg_base(handle) ((handle)._msg + 0) #define ns_msg_end(handle) ((handle)._eom + 0) #define ns_msg_size(handle) ((handle)._eom - (handle)._msg) #define ns_msg_count(handle, section) ((handle)._counts[section] + 0) /* * This is a parsed record. It is caller allocated and has no dynamic data. */ typedef struct __ns_rr { char name[NS_MAXDNAME]; u_int16_t type; u_int16_t rr_class; u_int32_t ttl; u_int16_t rdlength; const u_char * rdata; } ns_rr; /* Accessor macros - this is part of the public interface. */ #define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".") #define ns_rr_type(rr) ((ns_type)((rr).type + 0)) #define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0)) #define ns_rr_ttl(rr) ((rr).ttl + 0) #define ns_rr_rdlen(rr) ((rr).rdlength + 0) #define ns_rr_rdata(rr) ((rr).rdata + 0) /* * These don't have to be in the same order as in the packet flags word, * and they can even overlap in some cases, but they will need to be kept * in synch with ns_parse.c:ns_flagdata[]. */ typedef enum __ns_flag { ns_f_qr, /* Question/Response. */ ns_f_opcode, /* Operation code. */ ns_f_aa, /* Authoritative Answer. */ ns_f_tc, /* Truncation occurred. */ ns_f_rd, /* Recursion Desired. */ ns_f_ra, /* Recursion Available. */ ns_f_z, /* MBZ. */ ns_f_ad, /* Authentic Data (DNSSEC). */ ns_f_cd, /* Checking Disabled (DNSSEC). */ ns_f_rcode, /* Response code. */ ns_f_max } ns_flag; /* * Currently defined opcodes. */ typedef enum __ns_opcode { ns_o_query = 0, /* Standard query. */ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ ns_o_status = 2, /* Name server status query (unsupported). */ /* Opcode 3 is undefined/reserved. */ ns_o_notify = 4, /* Zone change notification. */ ns_o_update = 5, /* Zone update message. */ ns_o_max = 6 } ns_opcode; /* * Currently defined response codes. */ typedef enum __ns_rcode { ns_r_noerror = 0, /* No error occurred. */ ns_r_formerr = 1, /* Format error. */ ns_r_servfail = 2, /* Server failure. */ ns_r_nxdomain = 3, /* Name error. */ ns_r_notimpl = 4, /* Unimplemented. */ ns_r_refused = 5, /* Operation refused. */ /* these are for BIND_UPDATE */ ns_r_yxdomain = 6, /* Name exists */ ns_r_yxrrset = 7, /* RRset exists */ ns_r_nxrrset = 8, /* RRset does not exist */ ns_r_notauth = 9, /* Not authoritative for zone */ ns_r_notzone = 10, /* Zone of record different from zone section */ ns_r_max = 11, /* The following are TSIG extended errors */ ns_r_badsig = 16, ns_r_badkey = 17, ns_r_badtime = 18 } ns_rcode; /* BIND_UPDATE */ typedef enum __ns_update_operation { ns_uop_delete = 0, ns_uop_add = 1, ns_uop_max = 2 } ns_update_operation; /* * This structure is used for TSIG authenticated messages */ struct ns_tsig_key { char name[NS_MAXDNAME], alg[NS_MAXDNAME]; unsigned char *data; int len; }; typedef struct ns_tsig_key ns_tsig_key; /* * This structure is used for TSIG authenticated TCP messages */ struct ns_tcp_tsig_state { int counter; struct dst_key *key; void *ctx; unsigned char sig[NS_PACKETSZ]; int siglen; }; typedef struct ns_tcp_tsig_state ns_tcp_tsig_state; #define NS_TSIG_FUDGE 300 #define NS_TSIG_TCP_COUNT 100 #define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT" #define NS_TSIG_ERROR_NO_TSIG -10 #define NS_TSIG_ERROR_NO_SPACE -11 #define NS_TSIG_ERROR_FORMERR -12 /* * Currently defined type values for resources and queries. */ typedef enum __ns_type { ns_t_invalid = 0, /* Cookie. */ ns_t_a = 1, /* Host address. */ ns_t_ns = 2, /* Authoritative server. */ ns_t_md = 3, /* Mail destination. */ ns_t_mf = 4, /* Mail forwarder. */ ns_t_cname = 5, /* Canonical name. */ ns_t_soa = 6, /* Start of authority zone. */ ns_t_mb = 7, /* Mailbox domain name. */ ns_t_mg = 8, /* Mail group member. */ ns_t_mr = 9, /* Mail rename name. */ ns_t_null = 10, /* Null resource record. */ ns_t_wks = 11, /* Well known service. */ ns_t_ptr = 12, /* Domain name pointer. */ ns_t_hinfo = 13, /* Host information. */ ns_t_minfo = 14, /* Mailbox information. */ ns_t_mx = 15, /* Mail routing information. */ ns_t_txt = 16, /* Text strings. */ ns_t_rp = 17, /* Responsible person. */ ns_t_afsdb = 18, /* AFS cell database. */ ns_t_x25 = 19, /* X_25 calling address. */ ns_t_isdn = 20, /* ISDN calling address. */ ns_t_rt = 21, /* Router. */ ns_t_nsap = 22, /* NSAP address. */ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ ns_t_sig = 24, /* Security signature. */ ns_t_key = 25, /* Security key. */ ns_t_px = 26, /* X.400 mail mapping. */ ns_t_gpos = 27, /* Geographical position (withdrawn). */ ns_t_aaaa = 28, /* Ip6 Address. */ ns_t_loc = 29, /* Location Information. */ ns_t_nxt = 30, /* Next domain (security). */ ns_t_eid = 31, /* Endpoint identifier. */ ns_t_nimloc = 32, /* Nimrod Locator. */ ns_t_srv = 33, /* Server Selection. */ ns_t_atma = 34, /* ATM Address */ ns_t_naptr = 35, /* Naming Authority PoinTeR */ ns_t_kx = 36, /* Key Exchange */ ns_t_cert = 37, /* Certification record */ ns_t_a6 = 38, /* IPv6 address (deprecated, use ns_t_aaaa) */ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ ns_t_sink = 40, /* Kitchen sink (experimentatl) */ ns_t_opt = 41, /* EDNS0 option (meta-RR) */ ns_t_tsig = 250, /* Transaction signature. */ ns_t_ixfr = 251, /* Incremental zone transfer. */ ns_t_axfr = 252, /* Transfer zone of authority. */ ns_t_mailb = 253, /* Transfer mailbox records. */ ns_t_maila = 254, /* Transfer mail agent records. */ ns_t_any = 255, /* Wildcard match. */ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ ns_t_max = 65536 } ns_type; /* Exclusively a QTYPE? (not also an RTYPE) */ #define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \ (t) == ns_t_mailb || (t) == ns_t_maila) /* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */ #define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt) /* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */ #define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t)) #define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr) #define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \ (t) == ns_t_zxfr) /* * Values for class field */ typedef enum __ns_class { ns_c_invalid = 0, /* Cookie. */ ns_c_in = 1, /* Internet. */ ns_c_2 = 2, /* unallocated/unsupported. */ ns_c_chaos = 3, /* MIT Chaos-net. */ ns_c_hs = 4, /* MIT Hesiod. */ /* Query class values which do not appear in resource records */ ns_c_none = 254, /* for prereq. sections in update requests */ ns_c_any = 255, /* Wildcard match. */ ns_c_max = 65536 } ns_class; /* DNSSEC constants. */ typedef enum __ns_key_types { ns_kt_rsa = 1, /* key type RSA/MD5 */ ns_kt_dh = 2, /* Diffie Hellman */ ns_kt_dsa = 3, /* Digital Signature Standard (MANDATORY) */ ns_kt_private = 254 /* Private key type starts with OID */ } ns_key_types; typedef enum __ns_cert_types { cert_t_pkix = 1, /* PKIX (X.509v3) */ cert_tēģīĩķ·ļđš_spki = 2, /* SPKI */ cert_t_pgp = 3, /* PGP */ cert_t_url = 253, /* URL private type */ cert_t_oid = 254 /* OID private type */ } ns_cert_types; /* Flags field of the KEY RR rdata. */ #define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */ #define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */ #define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */ #define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */ #define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */ /* The type bits can also be interpreted independently, as single bits: */ #define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */ #define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */ #define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */ #define NS_KEY_EXTENDED_FLAGS 0x1000 /* reserved - must be zero */ #define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */ #define NS_KEY_RESERVED5 0x0400 /* reserved - must be zero */ #define NS_KEY_NAME_TYPE 0x0300 /* these bits determine the type */ #define NS_KEY_NAME_USER 0x0000 /* key is assoc. with user */ #define NS_KEY_NAME_ENTITY 0x0200 /* key is assoc. with entity eg host */ #define NS_KEY_NAME_ZONE 0x0100 /* key is zone key */ #define NS_KEY_NAME_RESERVED 0x0300 /* reserved meaning */ #define NS_KEY_RESERVED8 0x0080 /* reserved - must be zero */ #define NS_KEY_RESERVED9 0x0040 /* reserved - must be zero */ #define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */ #define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */ #define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */ #define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \ NS_KEY_RESERVED4 | \ NS_KEY_RESERVED5 | \ NS_KEY_RESERVED8 | \ NS_KEY_RESERVED9 | \ NS_KEY_RESERVED10 | \ NS_KEY_RESERVED11 ) #define NS_KEY_RESERVED_BITMASK2 0xFFFF /* no bits defined here */ /* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */ #define NS_ALG_MD5RSA 1 /* MD5 with RSA */ #define NS_ALG_DH 2 /* Diffie Hellman KEY */ #define NS_ALG_DSA 3 /* DSA KEY */ #define NS_ALG_DSS NS_ALG_DSA #define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */ #define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */ /* Protocol values */ /* value 0 is reserved */ #define NS_KEY_PROT_TLS 1 #define NS_KEY_PROT_EMAIL 2 #define NS_KEY_PROT_DNSSEC 3 #define NS_KEY_PROT_IPSEC 4 #define NS_KEY_PROT_ANY 255 /* Signatures */ #define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */ #define NS_MD5RSA_MAX_BITS 2552 /* Total of binary mod and exp */ #define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3) /* Max length of text sig block */ #define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4) #define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8) #define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8) #define NS_DSA_SIG_SIZE 41 #define NS_DSA_MIN_SIZE 213 #define NS_DSA_MAX_BYTES 405 /* Offsets into SIG record rdata to find various values */ #define NS_SIG_TYPE 0 /* Type flags */ #define NS_SIG_ALG 2 /* Algorithm */ #define NS_SIG_LABELS 3 /* How many labels in name */ #define NS_SIG_OTTL 4 /* Original TTL */ #define NS_SIG_EXPIR 8 /* Expiration time */ #define NS_SIG_SIGNED 12 /* Signature time */ #define NS_SIG_FOOT 16 /* Key footprint */ #define NS_SIG_SIGNER 18 /* Domain name of who signed it */ /* How RR types are represented as bit-flags in NXT records */ #define NS_NXT_BITS 8 #define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS))) #define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS))) #define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS))) #define NS_NXT_MAX 127 /* * Inline versions of get/put short/long. Pointer is advanced. */ #define NS_GET16(s, cp) do { \ register u_char *t_cp = (u_char *)(cp); \ (s) = ((u_int16_t)t_cp[0] << 8) \ | ((u_int16_t)t_cp[1]) \ ; \ (cp) += NS_INT16SZ; \ } while (0) #define NS_GET32(l, cp) do { \ register u_char *t_cp = (u_char *)(cp); \ (l) = ((u_int32_t)t_cp[0] << 24) \ | ((u_int32_t)t_cp[1] << 16) \ | ((u_int32_t)t_cp[2] << 8) \ | ((u_int32_t)t_cp[3]) \ ; \ (cp) += NS_INT32SZ; \ } while (0) #define NS_PUT16(s, cp) do { \ register u_int16_t t_s = (u_int16_t)(s); \ register u_char *t_cp = (u_char *)(cp); \ *t_cp++ = t_s >> 8; \ *t_cp = t_s; \ (cp) += NS_INT16SZ; \ } while (0) #define NS_PUT32(l, cp) do { \ register u_int32_t t_l = (u_int32_t)(l); \ register u_char *t_cp = (u_char *)(cp); \ *t_cp++ = t_l >> 24; \ *t_cp++ = t_l >> 16; \ *t_cp++ = t_l >> 8; \ *t_cp = t_l; \ (cp) += NS_INT32SZ; \ } while (0) /* * ANSI C identifier hiding for bind's lib/nameser. */ #define ns_get16 __ns_get16 #define ns_get32 __ns_get32 #define ns_put16 __ns_put16 #define ns_put32 __ns_put32 #define ns_initparse __ns_initparse #define ns_skiprr __ns_skiprr #define ns_parserr __ns_parserr #define ns_sprintrr __ns_sprintrr #define ns_sprintrrf __ns_sprintrrf #define ns_format_ttl __ns_format_ttl #define ns_parse_ttl __ns_parse_ttl #define ns_datetosecs __ns_datetosecs #define ns_name_ntol __ns_name_ntol #define ns_name_ntop __ns_name_ntop #define ns_name_pton __ns_name_pton #define ns_name_unpack __ns_name_unpack #define ns_name_pack __ns_name_pack #define ns_name_compress __ns_name_compress #define ns_name_uncompress __ns_name_uncompress #define ns_name_skip __ns_name_skip #define ns_name_rollback __ns_name_rollback #define ns_sign __ns_sign #define ns_sign_tcp __ns_sign_tcp #define ns_sign_tcp_init __ns_sign_tcp_init #define ns_find_tsig __ns_find_tsig #define ns_verify __ns_verify #define ns_verify_tcp __ns_verify_tcp #define ns_verify_tcp_init __ns_verify_tcp_init #define ns_samedomain __ns_samedomain #define ns_subdomain __ns_subdomain #define ns_makecanon __ns_makecanon #define ns_samename __ns_samename __BEGIN_DECLS u_int ns_get16 (const u_char *) __THROW; u_long ns_get32 (const u_char *) __THROW; void ns_put16 (u_int, u_char *) __THROW; void ns_put32 (u_long, u_char *) __THROW; int ns_initparse (const u_char *, int, ns_msg *) __THROW; int ns_skiprr (const u_char *, const u_char *, ns_sect, int) __THROW; int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW; int ns_sprintrr (const ns_msg *, const ns_rr *, const char *, const char *, char *, size_t) __THROW; int ns_sprintrrf (const u_char *, size_t, const char *, ns_class, ns_type, u_long, const u_char *, size_t, const char *, const char *, char *, size_t) __THROW; int ns_format_ttl (u_long, char *, size_t) __THROW; int ns_parse_ttl (const char *, u_long *) __THROW; u_int32_t ns_datetosecs (const char *cp, int *errp) __THROW; int ns_name_ntol (const u_char *, u_char *, size_t) __THROW; int ns_name_ntop (const u_char *, char *, size_t) __THROW; int ns_name_pton (const char *, u_char *, size_t) __THROW; int ns_name_unpack (const u_char *, const u_char *, const u_char *, u_char *, size_t) __THROW; int ns_name_pack (const u_char *, u_char *, int, const u_char **, const u_char **) __THROW; int ns_name_uncompress (const u_char *, const u_char *, const u_char *, char *, size_t) __THROW; int ns_name_compress (const char *, u_char *, size_t, const u_char **, const u_char **) __THROW; int ns_name_skip (const u_char **, const u_char *) __THROW; void ns_name_rollback (const u_char *, const u_char **, const u_char **) __THROW; int ns_sign (u_char *, int *, int, int, void *, const u_char *, int, u_char *, int *, time_t) __THROW; int ns_sign_tcp (u_char *, int *, int, int, ns_tcp_tsig_state *, int) __THROW; int ns_sign_tcp_init (void *, const u_char *, int, ns_tcp_tsig_state *) __THROW; u_char *ns_find_tsig (u_char *, u_char *) __THROW; int ns_verify (u_char *, int *, void *, const u_char *, int, u_char *, int *, time_t *, int) __THROW; int ns_verify_tcp (u_char *, int *, ns_tcp_tsig_state *, int) __THROW; int ns_verify_tcp_init (void *, const u_char *, int, ns_tcp_tsig_state *) __THROW; int ns_samedomain (const char *, const char *) __THROW; int ns_subdomain (const char *, const char *) __THROW; int ns_makecanon (const char *, char *, size_t) __THROW; int ns_samename (const char *, const char *) __THROW; __END_DECLS #ifdef BIND_4_COMPAT #include #endif #endif /* !_ARPA_NAMESER_H_ */ /* Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _ARPA_INET_H #define _ARPA_INET_H 1 #include #include /* To define `struct in_addr'. */ /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined #endif __BEGIN_DECLS /* Convert Internet host address from numbers-and-dots notation in CP into binary data in network byte order. */ extern in_addr_t inet_addr (__const char *__cp) __THROW; /* Return the local host address part of the Internet address in IN. */ extern in_addr_t inet_lnaof (struct in_addr __in) __THROW; /* Make Internet host address in network byte order by combining the network number NET with the local address HOST. */ extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host) __THROW; /* Return network number part of the Internet address IN. */ extern in_addr_t inet_netof (struct in_addr __in) __THROW; /* Extract the network number in network byte order from the address in numbers-and-dots natation starting at CP. */ extern in_addr_t inet_network (__const char *__cp) __THROW; /* Convert Internet number in IN to ASCII representation. The return value is a pointer to an internal array containing the string. */ extern char *inet_ntoa (struct in_addr __in) __THROW; #ifdef __UCLIBC__ /* Recursion-safe flavor */ extern char *inet_ntoa_r (struct in_addr __in, char *__buf) __THROW; #endif /* Convert from presentation format of an Internet number in buffer starting at CP to the binary network format and store result for interface type AF in buffer starting at BUF. */ extern int inet_pton (int __af, __const char *__restrict __cp, void *__restrict __buf) __THROW; /* Convert a Internet address in binary network format for interface type AF in buffer starting at CP to presentation form and place result in buffer of length LEN astarting at BUF. */ extern __const char *inet_ntop (int __af, __const void *__restrict __cp, char *__restrict __buf, socklen_t __len) __THROW; /* The following functions are not part of XNS 5.2. */ #ifdef __USE_MISC /* Convert Internet host address from numbers-and-dots notation in CP into binary data and store the result in the structure INP. */ extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW; #if 0 /* Format a network number NET into presentation format and place result in buffer starting at BUF with length of LEN bytes. */ extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF in buffer starting at CP to presentation format. The result will specifiy BITS bits of the number. */ extern char *inet_net_ntop (int __af, __const void *__cp, int __bits, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF from presentation in buffer starting at CP to network format and store result int buffer starting at BUF of size LEN. */ extern int inet_net_pton (int __af, __const char *__cp, void *__buf, size_t __len) __THROW; /* Convert ASCII representation in hexadecimal form of the Internet address to binary form and place result in buffer of length LEN starting at BUF. */ extern unsigned int inet_nsap_addr (__const char *__cp, unsigned char *__buf, int __len) __THROW; /* Convert internet address in binary form in LEN bytes starting at CP a presentation form and place result in BUF. */ extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp, char *__buf) __THROW; #endif #endif __END_DECLS #endif /* arpa/inet.h */