u16 sadb_x_sa2_exttype; __u8 sadb_x_sa2_mode; __u8 sadb_x_sa2_reserved1; __u16 sadb_x_sa2_reserved2; __u32 sadb_x_sa2_sequence; __u32 sadb_x_sa2_reqid; } __attribute__((packed)); /* sizeof(struct sadb_x_sa2) == 16 */ struct sadb_x_policy { __u16 sadb_x_policy_len; __u16 sadb_x_policy_exttype; __u16 sadb_x_policy_type; __u8 sadb_x_policy_dir; __u8 sadb_x_policy_reserved; __u32 sadb_x_policy_id; __u32 sadb_x_policy_priority; } __attribute__((packed)); /* sizeof(struct sadb_x_policy) == 16 */ struct sadb_x_ipsecrequest { __u16 sadb_x_ipsecrequest_len; __u16 sadb_x_ipsecrequest_proto; __u8 sadb_x_ipsecrequest_mode; __u8 sadb_x_ipsecrequest_level; __u16 sadb_x_ipsecrequest_reserved1; __u32 sadb_x_ipsecrequest_reqid; __u32 sadb_x_ipsecrequest_reserved2; } __attribute__((packed)); /* sizeof(struct sadb_x_ipsecrequest) == 16 */ /* This defines the TYPE of Nat Traversal in use. Currently only one * type of NAT-T is supported, draft-ietf-ipsec-udp-encaps-06 */ struct sadb_x_nat_t_type { __u16 sadb_x_nat_t_type_len; __u16 sadb_x_nat_t_type_exttype; __u8 sadb_x_nat_t_type_type; __u8 sadb_x_nat_t_type_reserved[3]; } __attribute__((packed)); /* sizeof(struct sadb_x_nat_t_type) == 8 */ /* Pass a NAT Traversal port (Source or Dest port) */ struct sadb_x_nat_t_port { __u16 sadb_x_nat_t_port_len; __u16 sadb_x_nat_t_port_exttype; __be16 sadb_x_nat_t_port_port; __u16 sadb_x_nat_t_port_reserved; } __attribute__((packed)); /* sizeof(struct sadb_x_nat_t_port) == 8 */ /* Generic LSM security context */ struct sadb_x_sec_ctx { __u16 sadb_x_sec_len; __u16 sadb_x_sec_exttype; __u8 sadb_x_ctx_alg; /* LSMs: e.g., selinux == 1 */ __u8 sadb_x_ctx_doi; __u16 sadb_x_ctx_len; } __attribute__((packed)); /* sizeof(struct sadb_sec_ctx) = 8 */ /* Used by MIGRATE to pass addresses IKE will use to perform * negotiation with the peer */ struct sadb_x_kmaddress { __u16 sadb_x_kmaddress_len; __u16 sadb_x_kmaddress_exttype; __u32 sadb_x_kmaddress_reserved; } __attribute__((packed)); /* sizeof(struct sadb_x_kmaddress) == 8 */ /* Message types */ #define SADB_RESERVED 0 #define SADB_GETSPI 1 #define SADB_UPDATE 2 #define SADB_ADD 3 #define SADB_DELETE 4 #define SADB_GET 5 #define SADB_ACQUIRE 6 #define SADB_REGISTER 7 #define SADB_EXPIRE 8 #define SADB_FLUSH 9 #define SADB_DUMP 10 #define SADB_X_PROMISC 11 #define SADB_X_PCHANGE 12 #define SADB_X_SPDUPDATE 13 #define SADB_X_SPDADD 14 #define SADB_X_SPDDELETE 15 #define SADB_X_SPDGET 16 #define SADB_X_SPDACQUIRE 17 #define SADB_X_SPDDUMP 18 #define SADB_X_SPDFLUSH 19 #define SADB_X_SPDSETIDX 20 #define SADB_X_SPDEXPIRE 21 #define SADB_X_SPDDELETE2 22 #define SADB_X_NAT_T_NEW_MAPPING 23 #define SADB_X_MIGRATE 24 #define SADB_MAX 24 /* Security Association flags */ #define SADB_SAFLAGS_PFS 1 #define SADB_SAFLAGS_NOPMTUDISC 0x20000000 #define SADB_SAFLAGS_DECAP_DSCP 0x40000000 #define SADB_SAFLAGS_NOECN 0x80000000 /* Security Association states */ #define SADB_SASTATE_LARVAL 0 #define SADB_SASTATE_MATURE 1 #define SADB_SASTATE_DYING 2 #define SADB_SASTATE_DEAD 3 #define SADB_SASTATE_MAX 3 /* Security Association types */ #define SADB_SATYPE_UNSPEC 0 #define SADB_SATYPE_AH 2 #define SADB_SATYPE_ESP 3 #define SADB_SATYPE_RSVP 5 #define SADB_SATYPE_OSPFV2 6 #define SADB_SATYPE_RIPV2 7 #define SADB_SATYPE_MIP 8 #define SADB_X_SATYPE_IPCOMP 9 #define SADB_SATYPE_MAX 9 /* Authentication algorithms */ #define SADB_AALG_NONE 0 #define SADB_AALG_MD5HMAC 2 #define SADB_AALG_SHA1HMAC 3 #define SADB_X_AALG_SHA2_256HMAC 5 #define SADB_X_AALG_SHA2_384HMAC 6 #define SADB_X_AALG_SHA2_512HMAC 7 #define SADB_X_AALG_RIPEMD160HMAC 8 #define SADB_X_AALG_AES_XCBC_MAC 9 #define SADB_X_AALG_NULL 251 /* kame */ #define SADB_AALG_MAX 251 /* Encryption algorithms */ #define SADB_EALG_NONE 0 #define SADB_EALG_DESCBC 2 #define SADB_EALG_3DESCBC 3 #define SADB_X_EALG_CASTCBC 6 #define SADB_X_EALG_BLOWFISHCBC 7 #define SADB_EALG_NULL 11 #define SADB_X_EALG_AESCBC 12 #define SADB_X_EALG_AESCTR 13 #define SADB_X_EALG_AES_CCM_ICV8 14 #define SADB_X_EALG_AES_CCM_ICV12 15 #define SADB_X_EALG_AES_CCM_ICV16 16 #define SADB_X_EALG_AES_GCM_ICV8 18 #define SADB_X_EALG_AES_GCM_ICV12 19 #define SADB_X_EALG_AES_GCM_ICV16 20 #define SADB_X_EALG_CAMELLIACBC 22 #define SADB_X_EALG_NULL_AES_GMAC 23 #define SADB_EALG_MAX 253 /* last EALG */ /* private allocations should use 249-255 (RFC2407) */ #define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ #define SADB_X_EALG_TWOFISHCBC 253 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ /* Compression algorithms */ #define SADB_X_CALG_NONE 0 #define SADB_X_CALG_OUI 1 #define SADB_X_CALG_DEFLATE 2 #define SADB_X_CALG_LZS 3 #define SADB_X_CALG_LZJH 4 #define SADB_X_CALG_MAX 4 /* Extension Header values */ #define SADB_EXT_RESERVED 0 #define SADB_EXT_SA 1 #define SADB_EXT_LIFETIME_CURRENT 2 #define SADB_EXT_LIFETIME_HARD 3 #define SADB_EXT_LIFETIME_SOFT 4 #define SADB_EXT_ADDRESS_SRC 5 #define SADB_EXT_ADDRESS_DST 6 #define SADB_EXT_ADDRESS_PROXY 7 #define SADB_EXT_KEY_AUTH 8 #define SADB_EXT_KEY_ENCRYPT 9 #define SADB_EXT_IDENTITY_SRC 10 #define SADB_EXT_IDENTITY_DST 11 #define SADB_EXT_SENSITIVITY 12 #define SADB_EXT_PROPOSAL 13 #define SADB_EXT_SUPPORTED_AUTH 14 #define SADB_EXT_SUPPORTED_ENCRYPT 15 #define SADB_EXT_SPIRANGE 16 #define SADB_X_EXT_KMPRIVATE 17 #define SADB_X_EXT_POLICY 18 #define SADB_X_EXT_SA2 19 /* The next four entries are for setting up NAT Traversal */ #define SADB_X_EXT_NAT_T_TYPE 20 #define SADB_X_EXT_NAT_T_SPORT 21 #define SADB_X_EXT_NAT_T_DPORT 22 #define SADB_X_EXT_NAT_T_OA 23 #define SADB_X_EXT_SEC_CTX 24 /* Used with MIGRATE to pass @ to IKE for negotiation */ #define SADB_X_EXT_KMADDRESS 25 #define SADB_EXT_MAX 25 /* Identity Extension values */ #define SADB_IDENTTYPE_RESERVED 0 #define SADB_IDENTTYPE_PREFIX 1 #define SADB_IDENTTYPE_FQDN 2 #define SADB_IDENTTYPE_USERFQDN 3 #define SADB_IDENTTYPE_MAX 3 #endif /* !(_LINUX_PFKEY2_H) */ /* * Any part of this program may be used in documents licensed under * the GNU Free Documentation License, Version 1.1 or any later version * published by the Free Software Foundation. */ #ifndef _PARPORT_H_ #define _PARPORT_H_ /* Start off with user-visible constants */ /* Maximum of 16 ports per machine */ #define PARPORT_MAX 16 /* Magic numbers */ #define PARPORT_IRQ_NONE -1 #define PARPORT_DMA_NONE -1 #define PARPORT_IRQ_AUTO -2 #define PARPORT_DMA_AUTO -2 #define PARPORT_DMA_NOFIFO -3 #define PARPORT_DISABLE -2 #define PARPORT_IRQ_PROBEONLY -3 #define PARPORT_IOHI_AUTO -1 #define PARPORT_CONTROL_STROBE 0x1 #define PARPORT_CONTROL_AUTOFD 0x2 #define PARPORT_CONTROL_INIT 0x4 #define PARPORT_CONTROL_SELECT 0x8 #define PARPORT_STATUS_ERROR 0x8 #define PARPORT_STATUS_SELECT 0x10 #define PARPORT_STATUS_PAPEROUT 0x20 #define PARPORT_STATUS_ACK 0x40 #define PARPORT_STATUS_BUSY 0x80 /* Type classes for Plug-and-Play probe. */ typedef enum { PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */ PARPORT_CLASS_PRINTER, PARPORT_CLASS_MODEM, PARPORT_CLASS_NET, PARPORT_CLASS_HDC, /* Hard disk controller */ PARPORT_CLASS_PCMCIA, PARPORT_CLASS_MEDIA, /* Multimedia device */ PARPORT_CLASS_FDC, /* Floppy disk controller */ PARPORT_CLASS_PORTS, PARPORT_CLASS_SCANNER, PARPORT_CLASS_DIGCAM, PARPORT_CLASS_OTHER, /* Anything else */ PARPORT_CLASS_UNSPEC, /* No CLS field in ID */ PARPORT_CLASS_SCSIADAPTER } parport_device_class; /* The "modes" entry in parport is a bit field representing the capabilities of the hardware. */ #define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */ #define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */ #define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */ #define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */ #define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */ #define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */ #define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */ /* IEEE1284 modes: Nibble mode, byte mode, ECP, ECPRLE and EPP are their own 'extensibility request' values. Others are special. 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */ #define IEEE1284_MODE_NIBBLE 0 #define IEEE1284_MODE_BYTE (1<<0) #define IEEE1284_MODE_COMPAT (1<<8) #define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */ #define IEEE1284_MODE_ECP (1<<4) #define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5)) #define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */ #define IEEE1284_MODE_EPP (1<<6) #define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */ #define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */ #define IEEE1284_DEVICEID (1<<2) /* This is a flag */ #define IEEE1284_EXT_LINK (1<<14) /* This flag causes the * extensibility link to * be requested, using * bits 0-6. */ /* For the benefit of parport_read/write, you can use these with * parport_negotiate to use address operations. They have no effect * other than to make parport_read/write use address transfers. */ #define IEEE1284_ADDR (1<<13) /* This is a flag */ #define IEEE1284_DATA 0 /* So is this */ /* Flags for block transfer operations. */ #define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */ #define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */ /* The rest is for the kernel only */ #endif /* _PARPORT_H_ */ #ifndef _LINUX_NVRAM_H #define _LINUX_NVRAM_H #include /* /dev/nvram ioctls */ #define NVRAM_INIT _IO('p', 0x40) /* initialize NVRAM and set checksum */ #define NVRAM_SETCKS _IO('p', 0x41) /* recalculate checksum */ /* for all current systems, this is where NVRAM starts */ #define NVRAM_FIRST_BYTE 14 /* all these functions expect an NVRAM offset, not an absolute */ #define NVRAM_OFFSET(x) ((x)-NVRAM_FIRST_BYTE) #endif /* _LINUX_NVRAM_H */ #ifndef _LINUX_IPSEC_H #define _LINUX_IPSEC_H /* The definitions, required to talk to KAME racoon IKE. */ #include #define IPSEC_PORT_ANY 0 #define IPSEC_ULPROTO_ANY 255 #define IPSEC_PROTO_ANY 255 enum { IPSEC_MODE_ANY = 0, /* We do not support this for SA */ IPSEC_MODE_TRANSPORT = 1, IPSEC_MODE_TUNNEL = 2, IPSEC_MODE_BEET = 3 }; enum { IPSEC_DIR_ANY = 0, IPSEC_DIR_INBOUND = 1, IPSEC_DIR_OUTBOUND = 2, IPSEC_DIR_FWD = 3, /* It is our own */ IPSEC_DIR_MAX = 4, IPSEC_DIR_INVALID = 5 }; enum { IPSEC_POLICY_DISCARD = 0, IPSEC_POLICY_NONE = 1, IPSEC_POLICY_IPSEC = 2, IPSEC_POLICY_ENTRUST = 3, IPSEC_POLICY_BYPASS = 4 }; enum { IPSEC_LEVEL_DEFAULT = 0, IPSEC_LEVEL_USE = 1, IPSEC_LEVEL_REQUIRE = 2, IPSEC_LEVEL_UNIQUE = 3 }; #define IPSEC_MANUAL_REQID_MAX 0x3fff #define IPSEC_REPLAYWSIZE 32 #endif /* _LINUX_IPSEC_H */ /* Copyright (C) 2003 Krzysztof Benedyczak & Michal Wronski This program 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. It 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 this software; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _LINUX_MQUEUE_H #define _LINUX_MQUEUE_H #define MQ_PRIO_MAX 32768 /* per-uid limit of kernel memory used by mqueue, in bytes */ #define MQ_BYTES_MAX 819200 struct mq_attr { long mq_flags; /* message queue flags */ long mq_maxmsg; /* maximum number of messages */ long mq_msgsize; /* maximum message size */ long mq_curmsgs; /* number of messages currently queued */ long __reserved[4]; /* ignored for input, zeroed for output */ }; /* * SIGEV_THREAD implementation: * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed * to mq_notify, then * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not * necessary that the socket is bound. * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN * bytes long. * If the notification is triggered, then the cookie is sent to the netlink * socket. The last byte of the cookie is replaced with the NOTIFY_?? codes: * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was * removed, either due to a close() on the message queue fd or due to a * mq_notify() that removed the notification. */ #define NOTIFY_NONE 0 #define NOTIFY_WOKENUP 1 #define NOTIFY_REMOVED 2 #define NOTIFY_COOKIE_LEN 32 #endif #ifndef _GAMEPORT_H #define _GAMEPORT_H /* * Copyright (c) 1999-2002 Vojtech Pavlik * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. */ #define GAMEPORT_MODE_DISABLED 0 #define GAMEPORT_MODE_RAW 1 #define GAMEPORT_MODE_COOKED 2 #define GAMEPORT_ID_VENDOR_ANALOG 0x0001 #define GAMEPORT_ID_VENDOR_MADCATZ 0x0002 #define GAMEPORT_ID_VENDOR_LOGITECH 0x0003 #define GAMEPORT_ID_VENDOR_CREATIVE 0x0004 #define GAMEPORT_ID_VENDOR_GENIUS 0x0005 #define GAMEPORT_ID_VENDOR_INTERACT 0x0006 #define GAMEPORT_ID_VENDOR_MICROSOFT 0x0007 #define GAMEPORT_ID_VENDOR_THRUSTMASTER 0x0008 #define GAMEPORT_ID_VENDOR_GRAVIS 0x0009 #define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a #endif #ifndef _LINUX_SCHED_H #define _LINUX_SCHED_H /* * cloning flags: */ #define CSIGNAL 0x000000ff /* signal mask to be sent at exit */ #define CLONE_VM 0x00000100 /* set if VM shared between processes */ #define CLONE_FS 0x00000200 /* set if fs info shared between processes */ #define CLONE_FILES 0x00000400 /* set if open files shared between processes */ #define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */ #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */ #define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ #define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */ #define CLONE_THREAD 0x00010000 /* Same thread group? */ #define CLONE_NEWNS 0x00020000 /* New namespace group? */ #define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */ #define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */ #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */ #define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */ #define CLONE_DETACHED 0x00400000 /* Unused, ignored */ #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ #define CLONE_NEWIPC 0x08000000 /* New ipcs */ #define CLONE_NEWUSER 0x10000000 /* New user namespace */ #define CLONE_NEWPID 0x20000000 /* New pid namespace */ #define CLONE_NEWNET 0x40000000 /* New network namespace */ #define CLONE_IO 0x80000000 /* Clone io context */ /* * Scheduling policies */ #define SCHED_NORMAL 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #define SCHED_BATCH 3 /* SCHED_ISO: reserved but not implemented yet */ #define SCHED_IDLE 5 /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */ #define SCHED_RESET_ON_FORK 0x40000000 #endif /* * Inode based directory notification for Linux * * Copyright (C) 2005 John McCutchan */ #ifndef _LINUX_INOTIFY_H #define _LINUX_INOTIFY_H /* For O_CLOEXEC and O_NONBLOCK */ #include #include /* * struct inotify_event - structure read from the inotify device for each event * * When you are watching a directory, you will receive the filename for events * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd. */ struct inotify_event { __s32 wd; /* watch descriptor */ __u32 mask; /* watch mask */ __u32 cookie; /* cookie to synchronize two events */ __u32 len; /* length (including nulls) of name */ char name[0]; /* stub for possible name */ }; /* the following are legal, implemented events that user-space can watch for */ #define IN_ACCESS 0x00000001 /* File was accessed */ #define IN_MODIFY 0x00000002 /* File was modified */ #define IN_ATTRIB 0x00000004 /* Metadata changed */ #define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */ #define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ #define IN_OPEN 0x00000020 /* File was opened */ #define IN_MOVED_FROM 0x00000040 /* File was moved from X */ #define IN_MOVED_TO 0x00000080 /* File was moved to Y */ #define IN_CREATE 0x00000100 /* Subfile was created */ #define IN_DELETE 0x00000200 /* Subfile was deleted */ #define IN_DELETE_SELF 0x00000400 /* Self was deleted */ #define IN_MOVE_SELF 0x00000800 /* Self was moved */ /* the following are legal events. they are sent as needed to any watch */ #define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ #define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ #define IN_IGNORED 0x00008000 /* File was ignored */ /* helper events */ #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */ #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ /* special flags */ #define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */ #define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */ #define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */ #define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ #define IN_ISDIR 0x40000000 /* event occurred against dir */ #define IN_ONESHOT 0x80000000 /* only send event once */ /* * All of the events - we build the list by hand so that we can add flags in * the future and not break backward compatibility. Apps will get only the * events that they originally wanted. Be sure to add new events here! */ #define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \ IN_MOVE_SELF) /* Flags for sys_inotify_init1. */ #define IN_CLOEXEC O_CLOEXEC #define IN_NONBLOCK O_NONBLOCK #endif /* _LINUX_INOTIFY_H */ /* * NFS protocol definitions * * This file contains constants mostly for Version 2 of the protocol, * but also has a couple of NFSv3 bits in (notably the error codes). */ #ifndef _LINUX_NFS_H #define _LINUX_NFS_H #define NFS_PROGRAM 100003 #define NFS_PORT 2049 #define NFS_MAXDATA 8192 #define NFS_MAXPATHLEN 1024 #define NFS_MAXNAMLEN 255 #define NFS_MAXGROUPS 16 #define NFS_FHSIZE 32 #define NFS_COOKIESIZE 4 #define NFS_FIFO_DEV (-1) #define NFSMODE_FMT 0170000 #define NFSMODE_DIR 0040000 #define NFSMODE_CHR 0020000 #define NFSMODE_BLK 0060000 #define NFSMODE_REG 0100000 #define NFSMODE_LNK 0120000 #define NFSMODE_SOCK 0140000 #define NFSMODE_FIFO 0010000 #define NFS_MNT_PROGRAM 100005 #define NFS_MNT_VERSION 1 #define NFS_MNT3_VERSION 3 /* * NFS stats. The good thing with these values is that NFSv3 errors are * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which * no-one uses anyway), so we can happily mix code as long as we make sure * no NFSv3 errors are returned to NFSv2 clients. * Error codes that have a `--' in the v2 column are not part of the * standard, but seem to be widely used nevertheless. */ enum nfs_stat { NFS_OK = 0, /* v2 v3 v4 */ NFSERR_PERM = 1, /* v2 v3 v4 */ NFSERR_NOENT = 2, /* v2 v3 v4 */ NFSERR_IO = 5, /* v2 v3 v4 */ NFSERR_NXIO = 6, /* v2 v3 v4 */ NFSERR_EAGAIN = 11, /* v2 v3 */ NFSERR_ACCES = 13, /* v2 v3 v4 */ NFSERR_EXIST = 17, /* v2 v3 v4 */ NFSERR_XDEV = 18, /* v3 v4 */ NFSERR_NODEV = 19, /* v2 v3 v4 */ NFSERR_NOTDIR = 20, /* v2 v3 v4 */ NFSERR_ISDIR = 21, /* v2 v3 v4 */ NFSERR_INVAL = 22, /* v2 v3 v4 */ NFSERR_FBIG = 27, /* v2 v3 v4 */ NFSERR_NOSPC = 28, /* v2 v3 v4 */ NFSERR_ROFS = 30, /* v2 v3 v4 */ NFSERR_MLINK = 31, /* v3 v4 */ NFSERR_OPNOTSUPP = 45, /* v2 v3 */ NFSERR_NAMETOOLONG = 63, /* v2 v3 v4 */ NFSERR_NOTEMPTY = 66, /* v2 v3 v4 */ NFSERR_DQUOT = 69, /* v2 v3 v4 */ NFSERR_STALE = 70, /* v2 v3 v4 */ NFSERR_REMOTE = 71, /* v2 v3 */ NFSERR_WFLUSH = 99, /* v2 */ NFSERR_BADHANDLE = 10001, /* v3 v4 */ NFSERR_NOT_SYNC = 10002, /* v3 */ NFSERR_BAD_COOKIE = 10003, /* v3 v4 */ NFSERR_NOTSUPP = 10004, /* v3 v4 */ NFSERR_TOOSMALL = 10005, /* v3 v4 */ NFSERR_SERVERFAULT = 10006, /* v3 v4 */ NFSERR_BADTYPE = 10007, /* v3 v4 */ NFSERR_JUKEBOX = 10008, /* v3 v4 */ NFSERR_SAME = 10009, /* v4 */ NFSERR_DENIED = 10010, /* v4 */ NFSERR_EXPIRED = 10011, /* v4 */ NFSERR_LOCKED = 10012, /* v4 */ NFSERR_GRACE = 10013, /* v4 */ NFSERR_FHEXPIRED = 10014, /* v4 */ NFSERR_SHARE_DENIED = 10015, /* v4 */ NFSERR_WRONGSEC = 10016, /* v4 */ NFSERR_CLID_INUSE = 10017, /* v4 */ NFSERR_RESOURCE = 10018, /* v4 */ NFSERR_MOVED = 10019, /* v4 */ NFSERR_NOFILEHANDLE = 10020, /* v4 */ NFSERR_MINOR_VERS_MISMATCH = 10021, /* v4 */ NFSERR_STALE_CLIENTID = 10022, /* v4 */ NFSERR_STALE_STATEID = 10023, /* v4 */ NFSERR_OLD_STATEID = 10024, /* v4 */ NFSERR_BAD_STATEID = 10025, /* v4 */ NFSERR_BAD_SEQID = 10026, /* v4 */ NFSERR_NOT_SAME = 10027, /* v4 */ NFSERR_LOCK_RANGE = 10028, /* v4 */ NFSERR_SYMLINK = 10029, /* v4 */ NFSERR_RESTOREFH = 10030, /* v4 */ NFSERR_LEASE_MOVED = 10031, /* v4 */ NFSERR_ATTRNOTSUPP = 10032, /* v4 */ NFSERR_NO_GRACE = 10033, /* v4 */ NFSERR_RECLAIM_BAD = 10034, /* v4 */ NFSERR_RECLAIM_CONFLICT = 10035,/* v4 */ NFSERR_BAD_XDR = 10036, /* v4 */ NFSERR_LOCKS_HELD = 10037, /* v4 */ NFSERR_OPENMODE = 10038, /* v4 */ NFSERR_BADOWNER = 10039, /* v4 */ NFSERR_BADCHAR = 10040, /* v4 */ NFSERR_BADNAME = 10041, /* v4 */ NFSERR_BAD_RANGE = 10042, /* v4 */ NFSERR_LOCK_NOTSUPP = 10043, /* v4 */ NFSERR_OP_ILLEGAL = 10044, /* v4 */ NFSERR_DEADLOCK = 10045, /* v4 */ NFSERR_FILE_OPEN = 10046, /* v4 */ NFSERR_ADMIN_REVOKED = 10047, /* v4 */ NFSERR_CB_PATH_DOWN = 10048, /* v4 */ }; /* NFSv2 file types - beware, these are not the same in NFSv3 */ enum nfs_ftype { NFNON = 0, NFREG = 1, NFDIR = 2, NFBLK = 3, NFCHR = 4, NFLNK = 5, NFSOCK = 6, NFBAD = 7, NFFIFO = 8 }; #endif /* _LINUX_NFS_H */ #ifndef _LINUX_STAT_H #define _LINUX_STAT_H #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #define S_IFMT 00170000 #define S_IFSOCK 0140000 #define S_IFLNK 0120000 #define S_IFREG 0100000 #define S_IFBLK 0060000 #define S_IFDIR 0040000 #define S_IFCHR 0020000 #define S_IFIFO 0010000 #define S_ISUID 0004000 #define S_ISGID 0002000 #define S_ISVTX 0001000 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) #define S_IRWXU 00700 #define S_IRUSR 00400 #define S_IWUSR 00200 #define S_IXUSR 00100 #define S_IRWXG 00070 #define S_IRGRP 00040 #define S_IWGRP 00020 #define S_IXGRP 00010 #define S_IRWXO 00007 #define S_IROTH 00004 #define S_IWOTH 00002 #define S_IXOTH 00001 #endif #endif /* * Copyright (C) 2006-2009 Red Hat, Inc. * * This file is released under the LGPL. */ #ifndef __DM_LOG_USERSPACE_H__ #define __DM_LOG_USERSPACE_H__ #include /* For DM_UUID_LEN */ /* * The device-mapper userspace log module consists of a kernel component and * a user-space component. The kernel component implements the API defined * in dm-dirty-log.h. Its purpose is simply to pass the parameters and * return values of those API functions between kernel and user-space. * * Below are defined the 'request_types' - DM_ULOG_CTR, DM_ULOG_DTR, etc. * These request types represent the different functions in the device-mapper * dirty log API. Each of these is described in more detail below. * * The user-space program must listen for requests from the kernel (representing * the various API functions) and process them. * * User-space begins by setting up the communication link (error checking * removed for clarity): * fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); * addr.nl_family = AF_NETLINK; * addr.nl_groups = CN_IDX_DM; * addr.nl_pid = 0; * r = bind(fd, (struct sockaddr *) &addr, sizeof(addr)); * opt = addr.nl_groups; * setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &opt, sizeof(opt)); * * User-space will then wait to receive requests form the kernel, which it * will process as described below. The requests are received in the form, * ((struct dm_ulog_request) + (additional data)). Depending on the request * type, there may or may not be 'additional data'. In the descriptions below, * you will see 'Payload-to-userspace' and 'Payload-to-kernel'. The * 'Payload-to-userspace' is what the kernel sends in 'additional data' as * necessary parameters to complete the request. The 'Payload-to-kernel' is * the 'additional data' returned to the kernel that contains the necessary * results of the request. The 'data_size' field in the dm_ulog_request * structure denotes the availability and amount of payload data. */ /* * DM_ULOG_CTR corresponds to (found in dm-dirty-log.h): * int (*ctr)(struct dm_dirty_log *log, struct dm_target *ti, * unsigned argc, char **argv); * * Payload-to-userspace: * A single string containing all the argv arguments separated by ' 's * Payload-to-kernel: * None. ('data_size' in the dm_ulog_request struct should be 0.) * * The UUID contained in the dm_ulog_request structure is the reference that * will be used by all request types to a specific log. The constructor must * record this assotiation with instance created. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_CTR 1 /* * DM_ULOG_DTR corresponds to (found in dm-dirty-log.h): * void (*dtr)(struct dm_dirty_log *log); * * Payload-to-userspace: * A single string containing all the argv arguments separated by ' 's * Payload-to-kernel: * None. ('data_size' in the dm_ulog_request struct should be 0.) * * The UUID contained in the dm_ulog_request structure is all that is * necessary to identify the log instance being destroyed. There is no * payload data. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and clearing * 'data_size' appropriately. */ #define DM_ULOG_DTR 2 /* * DM_ULOG_PRESUSPEND corresponds to (found in dm-dirty-log.h): * int (*presuspend)(struct dm_dirty_log *log); * * Payload-to-userspace: * None. * Payload-to-kernel: * None. * * The UUID contained in the dm_ulog_request structure is all that is * necessary to identify the log instance being presuspended. There is no * payload data. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_PRESUSPEND 3 /* * DM_ULOG_POSTSUSPEND corresponds to (found in dm-dirty-log.h): * int (*postsuspend)(struct dm_dirty_log *log); * * Payload-to-userspace: * None. * Payload-to-kernel: * None. * * The UUID contained in the dm_ulog_request structure is all that is * necessary to identify the log instance being postsuspended. There is no * payload data. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_POSTSUSPEND 4 /* * DM_ULOG_RESUME corresponds to (found in dm-dirty-log.h): * int (*resume)(struct dm_dirty_log *log); * * Payload-to-userspace: * None. * Payload-to-kernel: * None. * * The UUID contained in the dm_ulog_request structure is all that is * necessary to identify the log instance being resumed. There is no * payload data. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_RESUME 5 /* * DM_ULOG_GET_REGION_SIZE corresponds to (found in dm-dirty-log.h): * uint32_t (*get_region_size)(struct dm_dirty_log *log); * * Payload-to-userspace: * None. * Payload-to-kernel: * uint64_t - contains the region size * * The region size is something that was determined at constructor time. * It is returned in the payload area and 'data_size' is set to * reflect this. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field appropriately. */ #define DM_ULOG_GET_REGION_SIZE 6 /* * DM_ULOG_IS_CLEAN corresponds to (found in dm-dirty-log.h): * int (*is_clean)(struct dm_dirty_log *log, region_t region); * * Payload-to-userspace: * uint64_t - the region to get clean status on * Payload-to-kernel: * int64_t - 1 if clean, 0 otherwise * * Payload is sizeof(uint64_t) and contains the region for which the clean * status is being made. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - filling the payload with 0 (not clean) or * 1 (clean), setting 'data_size' and 'error' appropriately. */ #define DM_ULOG_IS_CLEAN 7 /* * DM_ULOG_IN_SYNC corresponds to (found in dm-dirty-log.h): * int (*in_sync)(struct dm_dirty_log *log, region_t region, * int can_block); * * Payload-to-userspace: * uint64_t - the region to get sync status on * Payload-to-kernel: * int64_t - 1 if in-sync, 0 otherwise * * Exactly the same as 'is_clean' above, except this time asking "has the * region been recovered?" vs. "is the region not being modified?" */ #define DM_ULOG_IN_SYNC 8 /* * DM_ULOG_FLUSH corresponds to (found in dm-dirty-log.h): * int (*flush)(struct dm_dirty_log *log); * * Payload-to-userspace: * None. * Payload-to-kernel: * None. * * No incoming or outgoing payload. Simply flush log state to disk. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and clearing * 'data_size' appropriately. */ #define DM_ULOG_FLUSH 9 /* * DM_ULOG_MARK_REGION corresponds to (found in dm-dirty-log.h): * void (*mark_region)(struct dm_dirty_log *log, region_t region); * * Payload-to-userspace: * uint64_t [] - region(s) to mark * Payload-to-kernel: * None. * * Incoming payload contains the one or more regions to mark dirty. * The number of regions contained in the payload can be determined from * 'data_size/sizeof(uint64_t)'. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and clearing * 'data_size' appropriately. */ #define DM_ULOG_MARK_REGION 10 /* * DM_ULOG_CLEAR_REGION corresponds to (found in dm-dirty-log.h): * void (*clear_region)(struct dm_dirty_log *log, region_t region); * * Payload-to-userspace: * uint64_t [] - region(s) to clear * Payload-to-kernel: * None. * * Incoming payload contains the one or more regions to mark clean. * The number of regions contained in the payload can be determined from * 'data_size/sizeof(uint64_t)'. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and clearing * 'data_size' appropriately. */ #define DM_ULOG_CLEAR_REGION 11 /* * DM_ULOG_GET_RESYNC_WORK corresponds to (found in dm-dirty-log.h): * int (*get_resync_work)(struct dm_dirty_log *log, region_t *region); * * Payload-to-userspace: * None. * Payload-to-kernel: * { * int64_t i; -- 1 if recovery necessary, 0 otherwise * uint64_t r; -- The region to recover if i=1 * } * 'data_size' should be set appropriately. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field appropriately. */ #define DM_ULOG_GET_RESYNC_WORK 12 /* * DM_ULOG_SET_REGION_SYNC corresponds to (found in dm-dirty-log.h): * void (*set_region_sync)(struct dm_dirty_log *log, * region_t region, int in_sync); * * Payload-to-userspace: * { * uint64_t - region to set sync state on * int64_t - 0 if not-in-sync, 1 if in-sync * } * Payload-to-kernel: * None. * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and clearing * 'data_size' appropriately. */ #define DM_ULOG_SET_REGION_SYNC 13 /* * DM_ULOG_GET_SYNC_COUNT corresponds to (found in dm-dirty-log.h): * region_t (*get_sync_count)(struct dm_dirty_log *log); * * Payload-to-userspace: * None. * Payload-to-kernel: * uint64_t - the number of in-sync regions * * No incoming payload. Kernel-bound payload contains the number of * regions that are in-sync (in a size_t). * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_GET_SYNC_COUNT 14 /* * DM_ULOG_STATUS_INFO corresponds to (found in dm-dirty-log.h): * int (*status)(struct dm_dirty_log *log, STATUSTYPE_INFO, * char *result, unsigned maxlen); * * Payload-to-userspace: * None. * Payload-to-kernel: * Character string containing STATUSTYPE_INFO * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_STATUS_INFO 15 /* * DM_ULOG_STATUS_TABLE corresponds to (found in dm-dirty-log.h): * int (*status)(struct dm_dirty_log *log, STATUSTYPE_TABLE, * char *result, unsigned maxlen); * * Payload-to-userspace: * None. * Payload-to-kernel: * Character string containing STATUSTYPE_TABLE * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_STATUS_TABLE 16 /* * DM_ULOG_IS_REMOTE_RECOVERING corresponds to (found in dm-dirty-log.h): * int (*is_remote_recovering)(struct dm_dirty_log *log, region_t region); * * Payload-to-userspace: * uint64_t - region to determine recovery status on * Payload-to-kernel: * { * int64_t is_recovering; -- 0 if no, 1 if yes * uint64_t in_sync_hint; -- lowest region still needing resync * } * * When the request has been processed, user-space must return the * dm_ulog_request to the kernel - setting the 'error' field and * 'data_size' appropriately. */ #define DM_ULOG_IS_REMOTE_RECOVERING 17 /* * (DM_ULOG_REQUEST_MASK & request_type) to get the request type * * Payload-to-userspace: * A single string containing all the argv arguments separated by ' 's * Payload-to-kernel: * None. ('data_size' in the dm_ulog_request struct should be 0.) * * We are reserving 8 bits of the 32-bit 'request_type' field for the * various request types above. The remaining 24-bits are currently * set to zero and are reserved for future use and compatibility concerns. * * User-space should always use DM_ULOG_REQUEST_TYPE to acquire the * request type from the้ึ๊ึ 'request_type' field to maintain forward compatibility. */ #define DM_ULOG_REQUEST_MASK 0xFF #define DM_ULOG_REQUEST_TYPE(request_type) \ (DM_ULOG_REQUEST_MASK & (request_type)) struct dm_ulog_request { /* * The local unique identifier (luid) and the universally unique * identifier (uuid) are used to tie a request to a specific * mirror log. A single machine log could probably make due with * just the 'luid', but a cluster-aware log must use the 'uuid' and * the 'luid'. The uuid is what is required for node to node * communication concerning a particular log, but the 'luid' helps * differentiate between logs that are being swapped and have the * same 'uuid'. (Think "live" and "inactive" device-mapper tables.) */ uint64_t luid; char uuid[DM_UUID_LEN]; char padding[7]; /* Padding because DM_UUID_LEN = 129 */ int32_t error; /* Used to report back processing errors */ uint32_t seq; /* Sequence number for request */ uint32_t request_type; /* DM_ULOG_* defined above */ uint32_t data_size; /* How much data (not including this struct) */ char data[0]; }; #endif /* __DM_LOG_USERSPACE_H__ */ #ifndef _IP6_TUNNEL_H #define _IP6_TUNNEL_H #include #define IPV6_TLV_TNL_ENCAP_LIMIT 4 #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4 /* don't add encapsulation limit if one isn't present in inner packet */ #define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1 /* copy the traffic class field from the inner packet */ #define IP6_TNL_F_USE_ORIG_TCLASS 0x2 /* copy the flowlabel from the inner packet */ #define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4 /* being used for Mobile IPv6 */ #define IP6_TNL_F_MIP6_DEV 0x8 /* copy DSCP from the outer packet */ #define IP6_TNL_F_RCV_DSCP_COPY 0x10 struct ip6_tnl_parm { char name[IFNAMSIZ]; /* name of tunnel device */ int link; /* ifindex of underlying L2 interface */ __u8 proto; /* tunnel protocol */ __u8 encap_limit; /* encapsulation limit for tunnel */ __u8 hop_limit; /* hop limit for tunnel */ __be32 flowinfo; /* traffic class and flowlabel for tunnel */ __u32 flags; /* tunnel flags */ struct in6_addr laddr; /* local tunnel end-point address */ struct in6_addr raddr; /* remote tunnel end-point address */ }; #endif #ifndef _LINUX_FCNTL_H #define _LINUX_FCNTL_H #include #define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0) #define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1) /* * Cancel a blocking posix lock; internal use only until we expose an * asynchronous lock api to userspace: */ #define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5) /* Create a file descriptor with FD_CLOEXEC set. */ #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6) /* * Request nofications on a directory. * See below for events that may be notified. */ #define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2) /* * Set and get of pipe page size array */ #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) /* * Types of directory notifications that may be requested. */ #define DN_ACCESS 0x00000001 /* File accessed */ #define DN_MODIFY 0x00000002 /* File modified */ #define DN_CREATE 0x00000004 /* File created */ #define DN_DELETE 0x00000008 /* File removed */ #define DN_RENAME 0x00000010 /* File renamed */ #define DN_ATTRIB 0x00000020 /* File changed attibutes */ #define DN_MULTISHOT 0x80000000 /* Don't remove notifier */ #define AT_FDCWD -100 /* Special value used to indicate openat should use the current working directory. */ #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ #define AT_REMOVEDIR 0x200 /* Remove directory instead of unlinking file. */ #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ #endif #ifndef _LINUX_ERRQUEUE_H #define _LINUX_ERRQUEUE_H 1 #include struct sock_extended_err { __u32 ee_errno; __u8 ee_origin; __u8 ee_type; __u8 ee_code; __u8 ee_pad; __u32 ee_info; __u32 ee_data; }; #define SO_EE_ORIGIN_NONE 0 #define SO_EE_ORIGIN_LOCAL 1 #define SO_EE_ORIGIN_ICMP 2 #define SO_EE_ORIGIN_ICMP6 3 #define SO_EE_ORIGIN_TIMESTAMPING 4 #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1)) #endif /* * ppp-comp.h - Definitions for doing PPP packet compression. * * Copyright (c) 1994 The Australian National University. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation is hereby granted, provided that the above copyright * notice appears in all copies. This software is provided without any * warranty, express or implied. The Australian National University * makes no representations about the suitability of this software for * any purpose. * * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. */ /* * ==FILEVERSION 980319== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the above date. * ppp-comp.h is shipped with a PPP distribution as well as with the kernel; * if everyone increases the FILEVERSION number above, then scripts * can do the right thing when deciding whether to install a new ppp-comp.h * file. Don't change the format of that line otherwise, so the * installation script can recognize it. */ #ifndef _NET_PPP_COMP_H #define _NET_PPP_COMP_H struct module; /* * The following symbols control whether we include code for * various compression methods. */ #ifndef DO_BSD_COMPRESS #define DO_BSD_COMPRESS 1 /* by default, include BSD-Compress */ #endif #ifndef DO_DEFLATE #define DO_DEFLATE 1 /* by default, include Deflate */ #endif #define DO_PREDICTOR_1 0 #define DO_PREDICTOR_2 0 /* * Structure giving methods for compression/decompression. */ struct compressor { int compress_proto; /* CCP compression protocol number */ /* Allocate space for a compressor (transmit side) */ void *(*comp_alloc) (unsigned char *options, int opt_len); /* Free space used by a compressor */ void (*comp_free) (void *state); /* Initialize a compressor */ int (*comp_init) (void *state, unsigned char *options, int opt_len, int unit, int opthdr, int debug); /* Reset a compressor */ void (*comp_reset) (void *state); /* Compress a packet */ int (*compress) (void *state, unsigned char *rptr, unsigned char *obuf, int isize, int osize); /* Return compression statistics */ void (*comp_stat) (void *state, struct compstat *stats); /* Allocate space for a decompressor (receive side) */ void *(*decomp_alloc) (unsigned char *options, int opt_len); /* Free space used by a decompressor */ void (*decomp_free) (void *state); /* Initialize a decompressor */ int (*decomp_init) (void *state, unsigned char *options, int opt_len, int unit, int opthdr, int mru, int debug); /* Reset a decompressor */ void (*decomp_reset) (void *state); /* Decompress a packet. */ int (*decompress) (void *state, unsigned char *ibuf, int isize, unsigned char *obuf, int osize); /* Update state for an incompressible packet received */ void (*incomp) (void *state, unsigned char *ibuf, int icnt); /* Return decompression statistics */ void (*decomp_stat) (void *state, struct compstat *stats); /* Used in locking compressor modules */ struct module *owner; /* Extra skb space needed by the compressor algorithm */ unsigned int comp_extra; }; /* * The return value from decompress routine is the length of the * decompressed packet if successful, otherwise DECOMP_ERROR * or DECOMP_FATALERROR if an error occurred. * * We need to make this distinction so that we can disable certain * useful functionality, namely sending a CCP reset-request as a result * of an error detected after decompression. This is to avoid infringing * a patent held by Motorola. * Don't you just lurve software patents. */ #define DECOMP_ERROR -1 /* error detected before decomp. */ #define DECOMP_FATALERROR -2 /* error detected after decomp. */ /* * CCP codes. */ #define CCP_CONFREQ 1 #define CCP_CONFACK 2 #define CCP_TERMREQ 5 #define CCP_TERMACK 6 #define CCP_RESETREQ 14 #define CCP_RESETACK 15 /* * Max # bytes for a CCP option */ #define CCP_MAX_OPTION_LENGTH 32 /* * Parts of a CCP packet. */ #define CCP_CODE(dp) ((dp)[0]) #define CCP_ID(dp) ((dp)[1]) #define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) #define CCP_HDRLEN 4 #define CCP_OPT_CODE(dp) ((dp)[0]) #define CCP_OPT_LENGTH(dp) ((dp)[1]) #define CCP_OPT_MINLEN 2 /* * Definitions for BSD-Compress. */ #define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ #define CILEN_BSD_COMPRESS 3 /* length of config. option */ /* Macros for handling the 3rd byte of the BSD-Compress config option. */ #define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ #define BSD_VERSION(x) ((x) >> 5) /* version of option format */ #define BSD_CURRENT_VERSION 1 /* current version number */ #define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) #define BSD_MIN_BITS 9 /* smallest code size supported */ #define BSD_MAX_BITS 15 /* largest code size supported */ /* * Definitions for Deflate. */ #define CI_DEFLATE 26 /* config option for Deflate */ #define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ #define CILEN_DEFLATE 4 /* length of its config option */ #define DEFLATE_MIN_SIZE 9 #define DEFLATE_MAX_SIZE 15 #define DEFLATE_METHOD_VAL 8 #define DEFLATE_SIZE(x) (((x) >> 4) + 8) #define DEFLATE_METHOD(x) ((x) & 0x0F) #define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) #define DEFLATE_CHK_SEQUENCE 0 /* * Definitions for MPPE. */ #define CI_MPPE 18 /* config option for MPPE */ #define CILEN_MPPE 6 /* length of config option */ /* * Definitions for other, as yet unsupported, compression methods. */ #define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ #define CILEN_PREDICTOR_1 2 /* length of its config option */ #define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ #define CILEN_PREDICTOR_2 2 /* length of its config option */ #endif /* _NET_PPP_COMP_H */ #ifndef _LINUX_ELF_H #define _LINUX_ELF_H #include #include struct file; #ifndef elf_read_implies_exec /* Executables for which elf_read_implies_exec() returns TRUE will have the READ_IMPLIES_EXEC personality flag set automatically. Override in asm/elf.h as needed. */ # define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 #endif /* 32-bit ELF base types. */ typedef __u32 Elf32_Addr; typedef __u16 Elf32_Half; typedef __u32 Elf32_Off; typedef __s32 Elf32_Sword; typedef __u32 Elf32_Word; /* 64-bit ELF base types. */ typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __s16 Elf64_SHalf; typedef __u64 Elf64_Off; typedef __s32 Elf64_Sword; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; typedef __s64 Elf64_Sxword; /* These constants are for the segment types stored in the image headers */ #define PT_NULL 0 #define PT_LOAD 1 #define PT_DYNAMIC 2 #define PT_INTERP 3 #define PT_NOTE 4 #define PT_SHLIB 5 #define PT_PHDR 6 #define PT_TLS 7 /* Thread local storage segment */ #define PT_LOOS 0x60000000 /* OS-specific */ #define PT_HIOS 0x6fffffff /* OS-specific */ #define PT_LOPROC 0x70000000 #define PT_HIPROC 0x7fffffff #define PT_GNU_EH_FRAME 0x6474e550 #define PT_GNU_STACK (PT_LOOS + 0x474e551) /* * Extended Numbering * * If the real number of program header table entries is larger than * or equal to PN_XNUM(0xffff), it is set to sh_info field of the * section header at index 0, and PN_XNUM is set to e_phnum * field. Otherwise, the section header at index 0 is zero * initialized, if it exists. * * Specifications are available in: * * - Sun microsystems: Linker and Libraries. * Part No: 817-1984-17, September 2008. * URL: http://docs.sun.com/app/docs/doc/817-1984 * * - System V ABI AMD64 Architecture Processor Supplement * Draft Version 0.99., * May 11, 2009. * URL: http://www.x86-64.org/ */ #define PN_XNUM 0xffff /* These constants define the different elf file types */ #define ET_NONE 0 #define ET_REL 1 #define ET_EXEC 2 #define ET_DYN 3 #define ET_CORE 4 #define ET_LOPROC 0xff00 #define ET_HIPROC 0xffff /* This is the info that is needed to parse the dynamic section of the file */ #define DT_NULL 0 #define DT_NEEDED 1 #define DT_PLTRELSZ 2 #define DT_PLTGOT 3 #define DT_HASH 4 #define DT_STRTAB 5 #define DT_SYMTAB 6 #define DT_RELA 7 #define DT_RELASZ 8 #define DT_RELAENT 9 #define DT_STRSZ 10 #define DT_SYMENT 11 #define DT_INIT 12 #define DT_FINI 13 #define DT_SONAME 14 #define DT_RPATH 15 #define DT_SYMBOLIC 16 #define DT_REL 17 #define DT_RELSZ 18 #define DT_RELENT 19 #define DT_PLTREL 20 #define DT_DEBUG 21 #define DT_TEXTREL 22 #define DT_JMPREL 23 #define DT_ENCODING 32 #define OLD_DT_LOOS 0x60000000 #define DT_LOOS 0x6000000d #define DT_HIOS 0x6ffff000 #define DT_VALRNGLO 0x6ffffd00 #define DT_VALRNGHI 0x6ffffdff #define DT_ADDRRNGLO 0x6ffffe00 #define DT_ADDRRNGHI 0x6ffffeff #define DT_VERSYM 0x6ffffff0 #define DT_RELACOUNT 0x6ffffff9 #define DT_RELCOUNT 0x6ffffffa #define DT_FLAGS_1 0x6ffffffb #define DT_VERDEF 0x6ffffffc #define DT_VERDEFNUM 0x6ffffffd #define DT_VERNEED 0x6ffffffe #define DT_VERNEEDNUM 0x6fffffff #define OLD_DT_HIOS 0x6fffffff #define DT_LOPROC 0x70000000 #define DT_HIPROC 0x7fffffff /* This info is needed when parsing the symbol table */ #define STB_LOCAL 0 #define STB_GLOBAL 1 #define STB_WEAK 2 #define STT_NOTYPE 0 #define STT_OBJECT 1 #define STT_FUNC 2 #define STT_SECTION 3 #define STT_FILE 4 #define STT_COMMON 5 #define STT_TLS 6 #define ELF_ST_BIND(x) ((x) >> 4) #define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf) #define ELF32_ST_BIND(x) ELF_ST_BIND(x) #define ELF32_ST_TYPE(x) ELF_ST_TYPE(x) #define ELF64_ST_BIND(x) ELF_ST_BIND(x) #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) typedef struct dynamic{ Elf32_Sword d_tag; union{ Elf32_Sword d_val; Elf32_Addr d_ptr; } d_un; } Elf32_Dyn; typedef struct { Elf64_Sxword d_tag; /* entry tag value */ union { Elf64_Xword d_val; Elf64_Addr d_ptr; } d_un; } Elf64_Dyn; /* The following are used with relocations */ #define ELF32_R_SYM(x) ((x) >> 8) #define ELF32_R_TYPE(x) ((x) & 0xff) #define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_TYPE(i) ((i) & 0xffffffff) typedef struct elf32_rel { Elf32_Addr r_offset; Elf32_Word r_info; } Elf32_Rel; typedef struct elf64_rel { Elf64_Addr r_offset; /* Location at which to apply the action */ Elf64_Xword r_info; /* index and type of relocation */ } Elf64_Rel; typedef struct elf32_rela{ Elf32_Addr r_offset; Elf32_Word r_info; Elf32_Sword r_addend; } Elf32_Rela; typedef struct elf64_rela { Elf64_Addr r_offset; /* Location at which to apply the action */ Elf64_Xword r_info; /* index and type of relocation */ Elf64_Sxword r_addend; /* Constant addend used to compute value */ } Elf64_Rela; typedef struct elf32_sym{ Elf32_Word st_name; Elf32_Addr st_value; Elf32_Word st_size; unsigned char st_info; unsigned char st_other; Elf32_Half st_shndx; } Elf32_Sym; typedef struct elf64_sym { Elf64_Word st_name; /* Symbol name, index in string tbl */ unsigned char st_info; /* Type and binding attributes */ unsigned char st_other; /* No defined meaning, 0 */ Elf64_Half st_shndx; /* Associated section index */ Elf64_Addr st_value; /* Value of the symbol */ Elf64_Xword st_size; /* Associated symbol size */ } Elf64_Sym; #define EI_NIDENT 16 typedef struct elf32_hdr{ unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; Elf32_Addr e_entry; /* Entry point */ Elf32_Off e_phoff; Elf32_Off e_shoff; Elf32_Word e_flags; Elf32_Half e_ehsize; Elf32_Half e_phentsize; Elf32_Half e_phnum; Elf32_Half e_shentsize; Elf32_Half e_shnum; Elf32_Half e_shstrndx; } Elf32_Ehdr; typedef struct elf64_hdr { unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */ Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; Elf64_Addr e_entry; /* Entry point virtual address */ Elf64_Off e_phoff; /* Program header table file offset */ Elf64_Off e_shoff; /* Section header table file offset */ Elf64_Word e_flags; Elf64_Half e_ehsize; Elf64_Half e_phentsize; Elf64_Half e_phnum; Elf64_Half e_shentsize; Elf64_Half e_shnum; Elf64_Half e_shstrndx; } Elf64_Ehdr; /* These constants define the permissions on sections in the program header, p_flags. */ #define PF_R 0x4 #define PF_W 0x2 #define PF_X 0x1 typedef struct elf32_phdr{ Elf32_Word p_type; Elf32_Off p_offset; Elf32_Addr p_vaddr; Elf32_Addr p_paddr; Elf32_Word p_filesz; Elf32_Word p_memsz; Elf32_Word p_flags; Elf32_Word p_align; } Elf32_Phdr; typedef struct elf64_phdr { Elf64_Word p_type; Elf64_Word p_flags; Elf64_Off p_offset; /* Segment file offset */ Elf64_Addr p_vaddr; /* Segment virtual address */ Elf64_Addr p_paddr; /* Segment physical address */ Elf64_Xword p_filesz; /* Segment size in file */ Elf64_Xword p_memsz; /* Segment size in memory */ Elf64_Xword p_align; /* Segment alignment, file & memory */ } Elf64_Phdr; /* sh_type */ #define SHT_NULL 0 #define SHT_PROGBITS 1 #define SHT_SYMTAB 2 #define SHT_STRTAB 3 #define SHT_RELA 4 #define SHT_HASH 5 #define SHT_DYNAMIC 6 #define SHT_NOTE 7 #define SHT_NOBITS 8 #define SHT_REL 9 #define SHT_SHLIB 10 #define SHT_DYNSYM 11 #define SHT_NUM 12 #define SHT_LOPROC 0x70000000 #define SHT_HIPROC 0x7fffffff #define SHT_LOUSER 0x80000000 #define SHT_HIUSER 0xffffffff /* sh_flags */ #define SHF_WRITE 0x1 #define SHF_ALLOC 0x2 #define SHF_EXECINSTR 0x4 #define SHF_MASKPROC 0xf0000000 /* special section indexes */ #define SHN_UNDEF 0 #define SHN_LORESERVE 0xff00 #define SHN_LOPROC 0xff00 #define SHN_HIPROC 0xff1f #define SHN_ABS 0xfff1 #define SHN_COMMON 0xfff2 #define SHN_HIRESERVE 0xffff typedef struct elf32_shdr { Elf32_Word sh_name; Elf32_Word sh_type; Elf32_Word sh_flags; Elf32_Addr sh_addr; Elf32_Off sh_offset; Elf32_Word sh_size; Elf32_Word sh_link; Elf32_Word sh_info; Elf32_Word sh_addralign; Elf32_Word sh_entsize; } Elf32_Shdr; typedef struct elf64_shdr { Elf64_Word sh_name; /* Section name, index in string tbl */ Elf64_Word sh_type; /* Type of section */ Elf64_Xword sh_flags; /* Miscellaneous section attributes */ Elf64_Addr sh_addr; /* Section virtual addr at execution */ Elf64_Off sh_offset; /* Section file offset */ Elf64_Xword sh_size; /* Size of section in bytes */ Elf64_Word sh_link; /* Index of another section */ Elf64_Word sh_info; /* Additional section information */ Elf64_Xword sh_addralign; /* Section alignment */ Elf64_Xword sh_entsize; /* Entry size if section holds table */ } Elf64_Shdr; #define EI_MAG0 0 /* e_ident[] indexes */ #define EI_MAG1 1 #define EI_MAG2 2 #define EI_MAG3 3 #define EI_CLASS 4 #define EI_DATA 5 #define EI_VERSION 6 #define EI_OSABI 7 #define EI_PAD 8 #define ELFMAG0 0x7f /* EI_MAG */ #define ELFMAG1 'E' #define ELFMAG2 'L' #define ELFMAG3 'F' #define ELFMAG "\177ELF" #define SELFMAG 4 #define ELFCLASSNONE 0 /* EI_CLASS */ #define ELFCLASS32 1