CTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int) #define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int) #endif /* __LINUX_IPMI_H */ #ifndef _LINUX_KDEV_T_H #define _LINUX_KDEV_T_H /* Some programs want their definitions of MAJOR and MINOR and MKDEV from the kernel sources. These must be the externally visible ones. */ #define MAJOR(dev) ((dev)>>8) #define MINOR(dev) ((dev) & 0xff) #define MKDEV(ma,mi) ((ma)<<8 | (mi)) #endif #ifndef __LINUX_RAW_H #define __LINUX_RAW_H #include #define RAW_SETBIND _IO( 0xac, 0 ) #define RAW_GETBIND _IO( 0xac, 1 ) struct raw_config_request { int raw_minor; __u64 block_major; __u64 block_minor; }; #define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS #endif /* __LINUX_RAW_H */ #ifndef _LINUX_VIRTIO_CONSOLE_H #define _LINUX_VIRTIO_CONSOLE_H #include #include #include /* * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so * anyone can use the definitions to implement compatible drivers/servers. * * Copyright (C) Red Hat, Inc., 2009, 2010 */ /* Feature bits */ #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ #define VIRTIO_CONSOLE_BAD_ID (~(u32)0) struct virtio_console_config { /* colums of the screens */ __u16 cols; /* rows of the screens */ __u16 rows; /* max. number of ports this device can hold */ __u32 max_nr_ports; } __attribute__((packed)); /* * A message that's passed between the Host and the Guest for a * particular port. */ struct virtio_console_control { __u32 id; /* Port number */ __u16 event; /* The kind of control event (see below) */ __u16 value; /* Extra information for the key */ }; /* Some events for control messages */ #define VIRTIO_CONSOLE_DEVICE_READY 0 #define VIRTIO_CONSOLE_PORT_ADD 1 #define VIRTIO_CONSOLE_PORT_REMOVE 2 #define VIRTIO_CONSOLE_PORT_READY 3 #define VIRTIO_CONSOLE_CONSOLE_PORT 4 #define VIRTIO_CONSOLE_RESIZE 5 #define VIRTIO_CONSOLE_PORT_OPEN 6 #define VIRTIO_CONSOLE_PORT_NAME 7 #endif /* _LINUX_VIRTIO_CONSOLE_H */ /* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * Global definitions for the Token-Ring IEEE 802.5 interface. * * Version: @(#)if_tr.h 0.0 07/11/94 * * Author: Fred N. van Kempen, * Donald Becker, * Peter De Schrijver, * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _LINUX_IF_TR_H #define _LINUX_IF_TR_H #include #include /* For __be16 */ /* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble and FCS/CRC (frame check sequence). */ #define TR_ALEN 6 /* Octets in one token-ring addr */ #define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc)) #define AC 0x10 #define LLC_FRAME 0x40 /* LLC and SNAP constants */ #define EXTENDED_SAP 0xAA #define UI_CMD 0x03 /* This is an Token-Ring frame header. */ struct trh_hdr { __u8 ac; /* access control field */ __u8 fc; /* frame control field */ __u8 daddr[TR_ALEN]; /* destination address */ __u8 saddr[TR_ALEN]; /* source address */ __be16 rcf; /* route control field */ __be16 rseg[8]; /* routing registers */ }; /* This is an Token-Ring LLC structure */ struct trllc { __u8 dsap; /* destination SAP */ __u8 ssap; /* source SAP */ __u8 llc; /* LLC control field */ __u8 protid[3]; /* protocol id */ __be16 ethertype; /* ether type field */ }; /* Token-Ring statistics collection data. */ struct tr_statistics { unsigned long rx_packets; /* total packets received */ unsigned long tx_packets; /* total packets transmitted */ unsigned long rx_bytes; /* total bytes received */ unsigned long tx_bytes; /* total bytes transmitted */ unsigned long rx_errors; /* bad packets received */ unsigned long tx_errors; /* packet transmit problems */ unsigned long rx_dropped; /* no space in linux buffers */ unsigned long tx_dropped; /* no space available in linux */ unsigned long multicast; /* multicast packets received */ unsigned long transmit_collision; /* detailed Token-Ring errors. See IBM Token-Ring Network Architecture for more info */ unsigned long line_errors; unsigned long internal_errors; unsigned long burst_errors; unsigned long A_C_errors; unsigned long abort_delimiters; unsigned long lost_frames; unsigned long recv_congest_count; unsigned long frame_copied_errors; unsigned long frequency_errors; unsigned long token_errors; unsigned long dummy1; }; /* source routing stuff */ #define TR_RII 0x80 #define TR_RCF_DIR_BIT 0x80 #define TR_RCF_LEN_MASK 0x1f00 #define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */ #define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */ #define TR_RCF_FRAME2K 0x20 #define TR_RCF_BROADCAST_MASK 0xC000 #define TR_MAXRIFLEN 18 #endif /* _LINUX_IF_TR_H */ #ifndef _LINUX_SIGNAL_H #define _LINUX_SIGNAL_H #include #include #endif /* _LINUX_SIGNAL_H */ /* atmsap.h - ATM Service Access Point addressing definitions */ /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ #ifndef _LINUX_ATMSAP_H #define _LINUX_ATMSAP_H #include /* * BEGIN_xx and END_xx markers are used for automatic generation of * documentation. Do not change them. */ /* * Layer 2 protocol identifiers */ /* BEGIN_L2 */ #define ATM_L2_NONE 0 /* L2 not specified */ #define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */ #define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */ #define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */ #define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */ #define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */ #define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */ #define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */ #define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */ #define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */ #define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */ #define ATM_L2_Q922 0x0e /* ITU-T Q.922 */ #define ATM_L2_USER 0x10 /* user-specified */ #define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */ /* END_L2 */ /* * Layer 3 protocol identifiers */ /* BEGIN_L3 */ #define ATM_L3_NONE 0 /* L3 not specified */ #define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */ #define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */ #define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */ #define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */ #define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */ #define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */ #define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */ #define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */ #define ATM_L3_USER 0x10 /* user-specified */ /* END_L3 */ /* * High layer identifiers */ /* BEGIN_HL */ #define ATM_HL_NONE 0 /* HL not specified */ #define ATM_HL_ISO 0x01 /* ISO */ #define ATM_HL_USER 0x02 /* user-specific */ #define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */ #define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */ /* END_HL */ /* * ITU-T coded mode of operation */ /* BEGIN_IMD */ #define ATM_IMD_NONE 0 /* mode not specified */ #define ATM_IMD_NORMAL 1 /* normal mode of operation */ #define ATM_IMD_EXTENDED 2 /* extended mode of operation */ /* END_IMD */ /* * H.310 code points */ #define ATM_TT_NONE 0 /* terminal type not specified */ #define ATM_TT_RX 1 /* receive only */ #define ATM_TT_TX 2 /* send only */ #define ATM_TT_RXTX 3 /* receive and send */ #define ATM_MC_NONE 0 /* no multiplexing */ #define ATM_MC_TS 1 /* transport stream (TS) */ #define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */ #define ATM_MC_PS 3 /* program stream (PS) */ #define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */ #define ATM_MC_H221 5 /* ITU-T Rec. H.221 */ /* * SAP structures */ #define ATM_MAX_HLI 8 /* maximum high-layer information length */ struct atm_blli { unsigned char l2_proto; /* layer 2 protocol */ union { struct { unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */ /* absent */ unsigned char window; /* window size (k), 1-127 (0 to omit) */ } itu; /* ITU-T encoding */ unsigned char user; /* user-specified l2 information */ } l2; unsigned char l3_proto; /* layer 3 protocol */ union { struct { unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */ /* absent */ unsigned char def_size; /* default packet size (log2), 4-12 (0 to */ /* omit) */ unsigned char window;/* packet window size, 1-127 (0 to omit) */ } itu; /* ITU-T encoding */ unsigned char user; /* user specified l3 information */ struct { /* if l3_proto = ATM_L3_H310 */ unsigned char term_type; /* terminal type */ unsigned char fw_mpx_cap; /* forward multiplexing capability */ /* only if term_type != ATM_TT_NONE */ unsigned char bw_mpx_cap; /* backward multiplexing capability */ /* only if term_type != ATM_TT_NONE */ } h310; struct { /* if l3_proto = ATM_L3_TR9577 */ unsigned char ipi; /* initial protocol id */ unsigned char snap[5];/* IEEE 802.1 SNAP identifier */ /* (only if ipi == NLPID_IEEE802_1_SNAP) */ } tr9577; } l3; } __ATM_API_ALIGN; struct atm_bhli { unsigned char hl_type; /* high layer information type */ unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */ /* hl_type == ATM_HL_ISO) */ unsigned char hl_info[ATM_MAX_HLI];/* high layer information */ }; #define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */ struct atm_sap { struct atm_bhli bhli; /* local SAP, high-layer information */ struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN; /* local SAP, low-layer info */ }; static __inline__ int blli_in_use(struct atm_blli blli) { return blli.l2_proto || blli.l3_proto; } #endif #ifndef _LINUX_PRCTL_H #define _LINUX_PRCTL_H /* Values to pass as first argument to prctl() */ #define PR_SET_PDEATHSIG 1 /* Second arg is a signal */ #define PR_GET_PDEATHSIG 2 /* Second arg is a ptr to return the signal */ /* Get/set current->mm->dumpable */ #define PR_GET_DUMPABLE 3 #define PR_SET_DUMPABLE 4 /* Get/set unaligned access control bits (if meaningful) */ #define PR_GET_UNALIGN 5 #define PR_SET_UNALIGN 6 # define PR_UNALIGN_NOPRINT 1 /* silently fix up unaligned user accesses */ # define PR_UNALIGN_SIGBUS 2 /* generate SIGBUS on unaligned user access */ /* Get/set whether or not to drop capabilities on setuid() away from * uid 0 (as per security/commoncap.c) */ #define PR_GET_KEEPCAPS 7 #define PR_SET_KEEPCAPS 8 /* Get/set floating-point emulation control bits (if meaningful) */ #define PR_GET_FPEMU 9 #define PR_SET_FPEMU 10 # define PR_FPEMU_NOPRINT 1 /* silently emulate fp operations accesses */ # define PR_FPEMU_SIGFPE 2 /* don't emulate fp operations, send SIGFPE instead */ /* Get/set floating-point exception mode (if meaningful) */ #define PR_GET_FPEXC 11 #define PR_SET_FPEXC 12 # define PR_FP_EXC_SW_ENABLE 0x80 /* Use FPEXC for FP exception enables */ # define PR_FP_EXC_DIV 0x010000 /* floating point divide by zero */ # define PR_FP_EXC_OVF 0x020000 /* floating point overflow */ # define PR_FP_EXC_UND 0x040000 /* floating point underflow */ # define PR_FP_EXC_RES 0x080000 /* floating point inexact result */ # define PR_FP_EXC_INV 0x100000 /* floating point invalid operation */ # define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */ # define PR_FP_EXC_NONRECOV 1 /* async non-recoverable exc. mode */ # define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */ # define PR_FP_EXC_PRECISE 3 /* precise exception mode */ /* Get/set whether we use statistical process timing or accurate timestamp * based process timing */ #define PR_GET_TIMING 13 #define PR_SET_TIMING 14 # define PR_TIMING_STATISTICAL 0 /* Normal, traditional, statistical process timing */ # define PR_TIMING_TIMESTAMP 1 /* Accurate timestamp based process timing */ #define PR_SET_NAME 15 /* Set process name */ #define PR_GET_NAME 16 /* Get process name */ /* Get/set process endian */ #define PR_GET_ENDIAN 19 #define PR_SET_ENDIAN 20 # define PR_ENDIAN_BIG 0 # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ /* Get/set process seccomp mode */ #define PR_GET_SECCOMP 21 #define PR_SET_SECCOMP 22 /* Get/set the capability bounding set (as per security/commoncap.c) */ #define PR_CAPBSET_READ 23 #define PR_CAPBSET_DROP 24 /* Get/set the process' ability to use the timestamp counter instruction */ #define PR_GET_TSC 25 #define PR_SET_TSC 26 # define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */ # define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */ /* Get/set securebits (as per security/commoncap.c) */ #define PR_GET_SECUREBITS 27 #define PR_SET_SECUREBITS 28 /* * Get/set the timerslack as used by poll/select/nanosleep * A value of 0 means "use default" */ #define PR_SET_TIMERSLACK 29 #define PR_GET_TIMERSLACK 30 #define PR_TASK_PERF_EVENTS_DISABLE 31 #define PR_TASK_PERF_EVENTS_ENABLE 32 /* * Set early/late kill mode for hwpoison memory corruption. * This influences when the process gets killed on a memory corruption. */ #define PR_MCE_KILL 33 # define PR_MCE_KILL_CLEAR 0 # define PR_MCE_KILL_SET 1 # define PR_MCE_KILL_LATE 0 # define PR_MCE_KILL_EARLY 1 # define PR_MCE_KILL_DEFAULT 2 #define PR_MCE_KILL_GET 34 #endif /* _LINUX_PRCTL_H */ #ifndef __CODA_PSDEV_H #define __CODA_PSDEV_H #include #define CODA_PSDEV_MAJOR 67 #define MAX_CODADEVS 5 /* how many do we allow */ /* messages between coda filesystem in kernel and Venus */ struct upc_req { struct list_head uc_chain; caddr_t uc_data; u_short uc_flags; u_short uc_inSize; /* Size is at most 5000 bytes */ u_short uc_outSize; u_short uc_opcode; /* copied from data to save lookup */ int uc_unique; wait_queue_head_t uc_sleep; /* process' wait queue */ }; #define CODA_REQ_ASYNC 0x1 #define CODA_REQ_READ 0x2 #define CODA_REQ_WRITE 0x4 #define CODA_REQ_ABORT 0x8 #endif #ifndef __LINUX_MROUTE_H #define __LINUX_MROUTE_H #include #include /* * Based on the MROUTING 3.5 defines primarily to keep * source compatibility with BSD. * * See the mrouted code for the original history. * * Protocol Independent Multicast (PIM) data structures included * Carlos Picoto (cap@di.fc.ul.pt) * */ #define MRT_BASE 200 #define MRT_INIT (MRT_BASE) /* Activate the kernel mroute code */ #define MRT_DONE (MRT_BASE+1) /* Shutdown the kernel mroute */ #define MRT_ADD_VIF (MRT_BASE+2) /* Add a virtual interface */ #define MRT_DEL_VIF (MRT_BASE+3) /* Delete a virtual interface */ #define MRT_ADD_MFC (MRT_BASE+4) /* Add a multicast forwarding entry */ #define MRT_DEL_MFC (MRT_BASE+5) /* Delete a multicast forwarding entry */ #define MRT_VERSION (MRT_BASE+6) /* Get the kernel multicast version */ #define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */ #define MRT_PIM (MRT_BASE+8) /* enable PIM code */ #define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */ #define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */ #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1) #define SIOCGETRPF (SIOCPROTOPRIVATE+2) #define MAXVIFS 32 typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */ typedef unsigned short vifi_t; #define ALL_VIFS ((vifi_t)(-1)) /* * Same idea as select */ #define VIFM_SET(n,m) ((m)|=(1<<(n))) #define VIFM_CLR(n,m) ((m)&=~(1<<(n))) #define VIFM_ISSET(n,m) ((m)&(1<<(n))) #define VIFM_CLRALL(m) ((m)=0) #define VIFM_COPY(mfrom,mto) ((mto)=(mfrom)) #define VIFM_SAME(m1,m2) ((m1)==(m2)) /* * Passed by mrouted for an MRT_ADD_VIF - again we use the * mrouted 3.6 structures for compatibility */ struct vifctl { vifi_t vifc_vifi; /* Index of VIF */ unsigned char vifc_flags; /* VIFF_ flags */ unsigned char vifc_threshold; /* ttl limit */ unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ union { struct in_addr vifc_lcl_addr; /* Local interface address */ int vifc_lcl_ifindex; /* Local interface index */ }; struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ }; #define VIFF_TUNNEL 0x1 /* IPIP tunnel */ #define VIFF_SRCRT 0x2 /* NI */ #define VIFF_REGISTER 0x4 /* register vif */ #define VIFF_USE_IFINDEX 0x8 /* use vifc_lcl_ifindex instead of vifc_lcl_addr to find an interface */ /* * Cache manipulation structures for mrouted and PIMd */ struct mfcctl { struct in_addr mfcc_origin; /* Origin of mcast */ struct in_addr mfcc_mcastgrp; /* Group in question */ vifi_t mfcc_parent; /* Where it arrived */ unsigned char mfcc_ttls[MAXVIFS]; /* Where it is going */ unsigned int mfcc_pkt_cnt; /* pkt count for src-grp */ unsigned int mfcc_byte_cnt; unsigned int mfcc_wrong_if; int mfcc_expire; }; /* * Group count retrieval for mrouted */ struct sioc_sg_req { struct in_addr src; struct in_addr grp; unsigned long pktcnt; unsigned long bytecnt; unsigned long wrong_if; }; /* * To get vif packet counts */ struct sioc_vif_req { vifi_t vifi; /* Which iface */ unsigned long icount; /* In packets */ unsigned long ocount; /* Out packets */ unsigned long ibytes; /* In bytes */ unsigned long obytes; /* Out bytes */ }; /* * This is the format the mroute daemon expects to see IGMP control * data. Magically happens to be like an IP packet as per the original */ struct igmpmsg { __u32 unused1,unused2; unsigned char im_msgtype; /* What is this */ unsigned char im_mbz; /* Must be zero */ unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */ unsigned char unused3; struct in_addr im_src,im_dst; }; /* * That's all usermode folks */ #define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */ /* * Pseudo messages used by mrouted */ #define IGMPMSG_NOCACHE 1 /* Kern cache fill request to mrouted */ #define IGMPMSG_WRONGVIF 2 /* For PIM assert processing (unused) */ #define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */ #endif #ifndef __LINUX_UIO_H #define __LINUX_UIO_H #include /* * Berkeley style UIO structures - Alan Cox 1994. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ struct iovec { void *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ }; /* * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) */ #define UIO_FASTIOV 8 #define UIO_MAXIOV 1024 #endif /* * include/linux/bfs_fs.h - BFS data structures on disk. * Copyright (C) 1999 Tigran Aivazian */ #ifndef _LINUX_BFS_FS_H #define _LINUX_BFS_FS_H #include #define BFS_BSIZE_BITS 9 #define BFS_BSIZE (1<i_vtype) */ #define BFS_VDIR 2L #define BFS_VREG 1L /* BFS inode layout on disk */ struct bfs_inode { __le16 i_ino; __u16 i_unused; __le32 i_sblock; __le32 i_eblock; __le32 i_eoffset; __le32 i_vtype; __le32 i_mode; __le32 i_uid; __le32 i_gid; __le32 i_nlink; __le32 i_atime; __le32 i_mtime; __le32 i_ctime; __u32 i_padding[4]; }; #define BFS_NAMELEN 14 #define BFS_DIRENT_SIZE 16 #define BFS_DIRS_PER_BLOCK 32 struct bfs_dirent { __le16 ino; char name[BFS_NAMELEN]; }; /* BFS superblock layout on disk */ struct bfs_super_block { __le32 s_magic; __le32 s_start; __le32 s_end; __le32 s_from; __le32 s_to; __s32 s_bfrom; __s32 s_bto; char s_fsname[6]; char s_volume[6]; __u32 s_padding[118]; }; #define BFS_OFF2INO(offset) \ ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) #define BFS_INO2OFF(ino) \ ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) #define BFS_NZFILESIZE(ip) \ ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE) #define BFS_FILESIZE(ip) \ ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) #define BFS_FILEBLOCKS(ip) \ ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock)) #define BFS_UNCLEAN(bfs_sb, sb) \ ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) #endif /* _LINUX_BFS_FS_H */ #ifndef __NET_VETH_H_ #define __NET_VETH_H_ enum { VETH_INFO_UNSPEC, VETH_INFO_PEER, __VETH_INFO_MAX #define VETH_INFO_MAX (__VETH_INFO_MAX - 1) }; #endif #ifndef __UINPUT_H_ #define __UINPUT_H_ /* * User level driver support for input subsystem * * Heavily based on evdev.c by Vojtech Pavlik * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Aristeu Sergio Rozanski Filho * * Changes/Revisions: * 0.3 24/05/2006 (Anssi Hannula ) * - update ff support for the changes in kernel interface * - add UINPUT_VERSION * 0.2 16/10/2004 (Micah Dowty ) * - added force feedback support * - added UI_SET_PHYS * 0.1 20/06/2002 * - first public version */ #include #define UINPUT_VERSION 3 struct uinput_ff_upload { int request_id; int retval; struct ff_effect effect; struct ff_effect old; }; struct uinput_ff_erase { int request_id; int retval; int effect_id; }; /* ioctl */ #define UINPUT_IOCTL_BASE 'U' #define UI_DEV_CREATE _IO(UINPUT_IOCTL_BASE, 1) #define UI_DEV_DESTROY _IO(UINPUT_IOCTL_BASE, 2) #define UI_SET_EVBIT _IOW(UINPUT_IOCTL_BASE, 100, int) #define UI_SET_KEYBIT _IOW(UINPUT_IOCTL_BASE, 101, int) #define UI_SET_RELBIT _IOW(UINPUT_IOCTL_BASE, 102, int) #define UI_SET_ABSBIT _IOW(UINPUT_IOCTL_BASE, 103, int) #define UI_SET_MSCBIT _IOW(UINPUT_IOCTL_BASE, 104, int) #define UI_SET_LEDBIT _IOW(UINPUT_IOCTL_BASE, 105, int) #define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int) #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) #define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) #define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase) #define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase) /* * To write a force-feedback-capable driver, the upload_effect * and erase_effect callbacks in input_dev must be implemented. * The uinput driver will generate a fake input event when one of * these callbacks are invoked. The userspace code then uses * ioctls to retrieve additional parameters and send the return code. * The callback blocks until this return code is sent. * * The described callback mechanism is only used if ff_effects_max * is set. * * To implement upload_effect(): * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD. * A request ID will be given in 'value'. * 2. Allocate a uinput_ff_upload struct, fill in request_id with * the 'value' from the EV_UINPUT event. * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the * uinput_ff_upload struct. It will be filled in with the * ff_effects passed to upload_effect(). * 4. Perform the effect upload, and place a return code back into the uinput_ff_upload struct. * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the * uinput_ff_upload_effect struct. This will complete execution * of our upload_effect() handler. * * To implement erase_effect(): * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE. * A request ID will be given in 'value'. * 2. Allocate a uinput_ff_erase struct, fill in request_id with * the 'value' from the EV_UINPUT event. * 3. Issue a UI_BEGIN_FF_ERASE ioctl, giving it the * uinput_ff_erase struct. It will be filled in with the * effect ID passed to erase_effect(). * 4. Perform the effect erasure, and place a return code back * into the uinput_ff_erase struct. * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the * uinput_ff_erase_effect struct. This will complete execution * of our erase_effect() handler. */ /* * This is the new event type, used only by uinput. * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value' * is the unique request ID. This number was picked * arbitrarily, above EV_MAX (since the input system * never sees it) but in the range of a 16-bit int. */ #define EV_UINPUT 0x0101 #define UI_FF_UPLOAD 1 #define UI_FF_ERASE 2 #define UINPUT_MAX_NAME_SIZE 80 struct uinput_user_dev { char name[UINPUT_MAX_NAME_SIZE]; struct input_id id; int ff_effects_max; int absmax[ABS_CNT]; int absmin[ABS_CNT]; int absfuzz[ABS_CNT]; int absflat[ABS_CNT]; }; #endif /* __UINPUT_H_ */ #ifndef __LINUX_IF_PACKET_H #define __LINUX_IF_PACKET_H #include struct sockaddr_pkt { unsigned short spkt_family; unsigned char spkt_device[14]; __be16 spkt_protocol; }; struct sockaddr_ll { unsigned short sll_family; __be16 sll_protocol; int sll_ifindex; unsigned short 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 /* Outgoing of any type */ /* These ones are invisible by user level */ #define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */ #define PACKET_FASTROUTE 6 /* Fastrouted frame */ /* Packet socket options */ #define PACKET_ADD_MEMBERSHIP 1 #define PACKET_DROP_MEMBERSHIP 2 #define PACKET_RECV_OUTPUT 3 /* Value 4 is still used by obsolete turbo-packet. */ #define PACKET_RX_RING 5 #define PACKET_STATISTICS 6 #define PACKET_COPY_THRESH 7 #define PACKET_AUXDATA 8 #define PACKET_ORIGDEV 9 #define PACKET_VERSION 10 #define PACKET_HDRLEN 11 #define PACKET_RESERVE 12 #define PACKET_TX_RING 13 #define PACKET_LOSS 14 #define PACKET_VNET_HDR 15 #define PACKET_TX_TIMESTAMP 16 #define PACKET_TIMESTAMP 17 struct tpacket_stats { unsigned int tp_packets; unsigned int tp_drops; }; struct tpacket_auxdata { __u32 tp_status; __u32 tp_len; __u32 tp_snaplen; __u16 tp_mac; __u16 tp_net; __u16 tp_vlan_tci; }; /* Rx ring - header status */ #define TP_STATUS_KERNEL 0x0 #define TP_STATUS_USER 0x1 #define TP_STATUS_COPY 0x2 #define TP_STATUS_LOSING 0x4 #define TP_STATUS_CSUMNOTREADY 0x8 /* Tx ring - header status */ #define TP_STATUS_AVAILABLE 0x0 #define TP_STATUS_SEND_REQUEST 0x1 #define TP_STATUS_SENDING 0x2 #define TP_STATUS_WRONG_FORMAT 0x4 struct tpacket_hdr { unsigned long tp_status; unsigned int tp_len; unsigned int tp_snaplen; unsigned short tp_mac; unsigned short tp_net; unsigned int tp_sec; unsigned int tp_usec; }; #define TPACKET_ALIGNMENT 16 #define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) #define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) struct tpacket2_hdr { __u32 tp_status; __u32 tp_len; __u32 tp_snaplen; __u16 tp_mac; __u16 tp_net; __u32 tp_sec; __u32 tp_nsec; __u16 tp_vlan_tci; }; #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) enum tpacket_versions { TPACKET_V1, TPACKET_V2, }; /* Frame structure: - Start. Frame must be aligned to TPACKET_ALIGNMENT=16 - struct tpacket_hdr - pad to TPACKET_ALIGNMENT=16 - struct sockaddr_ll - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16 - Start+tp_mac: [ Optional MAC header ] - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16. - Pad to align to TPACKET_ALIGNMENT=16 */ struct tpacket_req { unsigned int tp_block_size; /* Minimal size of contiguous block */ unsigned int tp_block_nr; /* Number of blocks */ unsigned int tp_frame_size; /* Size of frame */ unsigned int tp_frame_nr; /* Total number of frames */ }; struct packet_mreq { int mr_ifindex; unsigned short mr_type; unsigned short mr_alen; unsigned char mr_address[8]; }; #define PACKET_MR_MULTICAST 0 #define PACKET_MR_PROMISC 1 #define PACKET_MR_ALLMULTI 2 #define PACKET_MR_UNICAST 3 #endif /* * ioctl interface for the scsi media changer driver */ /* changer element types */ #define CHET_MT 0 /* media transport element (robot) */ #define CHET_ST 1 /* storage element (media slots) */ #define CHET_IE 2 /* import/export element */ #define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */ #define CHET_V1 4 /* vendor specific #1 */ #define CHET_V2 5 /* vendor specific #2 */ #define CHET_V3 6 /* vendor specific #3 */ #define CHET_V4 7 /* vendor specific #4 */ /* * CHIOGPARAMS * query changer properties * * CHIOVGPARAMS * query vendor-specific element types * * accessing elements works by specifing type and unit of the element. * for example, storage elements are addressed with type = CHET_ST and * unit = 0 .. cp_nslots-1 * */ struct changer_params { int cp_curpicker; /* current transport element */ int cp_npickers; /* number of transport elements (CHET_MT) */ int cp_nslots; /* number of storage elements (CHET_ST) */ int cp_nportals; /* number of import/export elements (CHET_IE) */ int cp_ndrives; /* number of data transfer elements (CHET_DT) */ }; struct changer_vendor_params { int cvp_n1; /* number of vendor specific elems (CHET_V1) */ char cvp_label1[16]; int cvp_n2; /* number of vendor specific elems (CHET_V2) */ char cvp_label2[16]; int cvp_n3; /* number of vendor specific elems (CHET_V3) */ char cvp_label3[16]; int cvp_n4; /* number of vendor specific elems (CHET_V4) */ char cvp_label4[16]; int reserved[8]; }; /* * CHIOMOVE * move a medium from one element to another */ struct changer_move { int cm_fromtype; /* type/unit of source element */ int cm_fromunit; int cm_totype; /* type/unit of destination element */ int cm_tounit; int cm_flags; }; #define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */ /* * CHIOEXCHANGE * move one medium from element #1 to element #2, * and another one from element #2 to element #3. * element #1 and #3 are allowed to be identical. */ struct changer_exchange { int ce_srctype; /* type/unit of element #1 */ int ce_srcunit; int ce_fdsttype; /* type/unit of element #2 */ int ce_fdstunit; int ce_sdsttype; /* type/unit of element #3 */ int ce_sdstunit; int ce_flags; }; #define CE_INVERT1 1 #define CE_INVERT2 2 /* * CHIOPOSITION * move the transport element (robot arm) to a specific element. */ struct changer_position { int cp_type; int cp_unit; int cp_flags; }; #define CP_INVERT 1 /* * CHIOGSTATUS * get element status for all elements of a specific type */ struct changer_element_status { int ces_type; unsigned char *ces_data; }; #define CESTATUS_FULL 0x01 /* full */ #define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */ #define CESTATUS_EXCEPT 0x04 /* error condition */ #define CESTATUS_ACCESS 0x08 /* access allowed */ #define CESTATUS_EXENAB 0x10 /* element can export media */ #define CESTATUS_INENAB 0x20 /* element can import media */ /* * CHIOGELEM * get more detailed status information for a single element */ struct changer_get_element { int cge_type; /* type/unit */ int cge_unit; int cge_status; /* status */ int cge_errno; /* errno */ int cge_srctype; /* source element of the last move/exchange */ int cge_srcunit; int cge_id; /* scsi id (for data transfer elements) */ int cge_lun; /* scsi lun (for data transfer elements) */ char cge_pvoltag[36]; /* primary volume tag */ char cge_avoltag[36]; /* alternate volume tag */ int cge_flags; }; /* flags */ #define CGE_ERRNO 0x01 /* errno available */ #define CGE_INVERT 0x02 /* media inverted */ #define CGE_SRC 0x04 /* media src available */ #define CGE_IDLUN 0x08 /* ID+LUN available */ #define CGE_PVOLTAG 0x10 /* primary volume tag available */ #define CGE_AVOLTAG 0x20 /* alternate volume tag available */ /* * CHIOSVOLTAG * set volume tag */ struct changer_set_voltag { int csv_type; /* type/unit */ int csv_unit; char csv_voltag[36]; /* volume tag */ int csv_flags; }; #define CSV_PVOLTAG 0x01 /* primary volume tag */ #define CSV_AVOLTAG 0x02 /* alternate volume tag */ #define CSV_CLEARTAG 0x04 /* clear volume tag */ /* ioctls */ #define CHIOMOVE _IOW('c', 1,struct changer_move) #define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange) #define CHIOPOSITION _IOW('c', 3,struct changer_position) #define CHIOGPICKER _IOR('c', 4,int) /* not impl. */ #define CHIOSPICKER _IOW('c', 5,int) /* not impl. */ #define CHIOGPARAMS _IOR('c', 6,struct changer_params) #define CHIOGSTATUS _IOW('c', 8,struct changer_element_status) #define CHIOGELEM _IOW('c',16,struct changer_get_element) #define CHIOINITELEM _IO('c',17) #define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag) #define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params) /* ---------------------------------------------------------------------- */ /* * Local variables: * c-basic-offset: 8 * End: */ /* atmclip.h - Classical IP over ATM */ /* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ #ifndef LINUX_ATMCLIP_H #define LINUX_ATMCLIP_H #include #include #define RFC1483LLC_LEN 8 /* LLC+OUI+PID = 8 */ #define RFC1626_MTU 9180 /* RFC1626 default MTU */ #define CLIP_DEFAULT_IDLETIMER 1200 /* 20 minutes, see RFC1755 */ #define CLIP_CHECK_INTERVAL 10 /* check every ten seconds */ #define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */ #endif /* * ppp_defs.h - PPP definitions. * * 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. */ #include /* * ==FILEVERSION 20000114== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the above date. * ppp_defs.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_defs.h * file. Don't change the format of that line otherwise, so the * installation script can recognize it. */ #ifndef _PPP_DEFS_H_ #define _PPP_DEFS_H_ /* * The basic PPP frame. */ #define PPP_HDRLEN 4 /* octets for standard ppp header */ #define PPP_FCSLEN 2 /* octets for FCS */ #define PPP_MRU 1500 /* default MRU = max length of info field */ #define PPP_ADDRESS(p) (((__u8 *)(p))[0]) #define PPP_CONTROL(p) (((__u8 *)(p))[1]) #define PPP_PROTOCOL(p) ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3]) /* * Significant octet values. */ #define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ #define PPP_UI 0x03 /* Unnumbered Information */ #define PPP_FLAG 0x7e /* Flag Sequence */ #define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ #define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ /* * Protocol field values. */ #define PPP_IP 0x21 /* Internet Protocol */ #define PPP_AT 0x29 /* AppleTalk Protocol */ #define PPP_IPX 0x2b /* IPX protocol */ #define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ #define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ #define PPP_MP 0x3d /* Multilink protocol */ #define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ #define PPP_COMPFRAG 0xfb /* fragment compressed below bundle */ #define PPP_COMP 0xfd /* compressed packet */ #define PPP_MPLS_UC 0x0281 /* Multi Protocol Label Switching - Unicast */ #define PPP_MPLS_MC 0x0283 /* Multi Protocol Label Switching - Multicast */ #define PPP_IPCP 0x8021 /* IP Control Protocol */ #define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ #define PPP_IPXCP 0x802b /* IPX Control Protocol */ #define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #define PPP_CCPFRAG 0x80fb /* CCP at link level (below MP bundle) */ #define PPP_CCP 0x80fd /* Compression Control Protocol */ #define PPP_MPLSCP 0x80fd /* MPLS Control Protocol */ #define PPP_LCP 0xc021 /* Link Control Protocol */ #define PPP_PAP 0xc023 /* Password Authentication Protocol */ #define PPP_LQR 0xc025 /* Link Quality Report protocol */ #define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ #define PPP_CBCP 0xc029 /* Callback Control Protocol */ /* * Values for FCS calculations. */ #define PPP_INITFCS 0xffff /* Initial FCS value */ #define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ /* * Extended asyncmap - allows any character to be escaped. */ typedef __u32 ext_accm[8]; /* * What to do with network protocol (NP) packets. */ enum NPmode { NPMODE_PASS, /* pass the packet through */ NPMODE_DROP, /* silently drop the packet */ NPMODE_ERROR, /* return an error */ NPMODE_QUEUE /* save it up for later. */ }; /* * Statistics for LQRP and pppstats */ struct pppstat { __u32 ppp_discards; /* # frames discarded */ __u32 ppp_ibytes; /* bytes received */ __u32 ppp_ioctects; /* bytes received not in error */ __u32 ppp_ipackets; /* packets received */ __u32 ppp_ierrors; /* receive errors */ __u32 ppp_ilqrs; /* # LQR frames received */ __u32 ppp_obytes; /* raw bytes sent */ __u32 ppp_ooctects; /* frame bytes sent */ __u32 ppp_opackets; /* packets sent */ __u32 ppp_oerrors; /* transmit errors */ __u32 ppp_olqrs; /* # LQR frames sent */ }; struct vjstat { __u32 vjs_packets; /* outbound packets */ __u32 vjs_compressed; /* outbound compressed packets */ __u32 vjs_searches; /* searches for connection state */ __u32 vjs_misses; /* times couldn't find conn. state */ __u32 vjs_uncompressedin; /* inbound uncompressed packets */ __u32 vjs_compressedin; /* inbound compressed packets */ __u32 vjs_errorin; /* inbound unknown type packets */ __u32 vjs_tossed; /* inbound packets tossed because of error */ }; struct compstat { __u32 unc_bytes; /* total uncompressed bytes */ __u32 unc_packets; /* total uncompressed packets */ __u32 comp_bytes; /* compressed bytes */ __u32 comp_packets; /* compressed packets */ __u32 inc_bytes; /* incompressible bytes */ __u32 inc_packets; /* incompressible packets */ /* the compression ratio is defined as in_count / bytes_out */ __u32 in_count; /* Bytes received */ __u32 bytes_out; /* Bytes transmitted */ double ratio; /* not computed in kernel. */ }; struct ppp_stats { struct pppstat p; /* basic PPP statistics */ struct vjstat vj; /* VJ header compression statistics */ }; struct ppp_comp_stats { struct compstat c; /* packet compression statistics */ struct compstat d; /* packet decompression statistics */ }; /* * The following structure records the time in seconds since * the last NP packet was sent or received. */ struct ppp_idle { __kernel_time_t xmit_idle; /* time since last NP packet sent */ __kernel_time_t recv_idle; /* time since last NP packet received */ }; #endif /* _PPP_DEFS_H_ */ /*************************************************************************** * Linux PPP over X - Generic PPP transport layer sockets * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516) * * This file supplies definitions required by the PPP over Ethernet driver * (pppox.c). All version information wrt this file is located in pppox.c * * License: * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * */ #ifndef __LINUX_IF_PPPOX_H #define __LINUX_IF_PPPOX_H #include #include #include /* For user-space programs to pick up these definitions * which they wouldn't get otherwise without defining __KERNEL__ */ #ifndef AF_PPPOX #define AF_PPPOX 24 #define PF_PPPOX AF_PPPOX #endif /* !(AF_PPPOX) */ /************************************************************************ * PPPoE addressing definition */ typedef __be16 sid_t; struct pppoe_addr { sid_t sid; /* Session identifier */ unsigned char remote[ETH_ALEN]; /* Remote address */ char dev[IFNAMSIZ]; /* Local device to use */ }; /************************************************************************ * PPTP addressing definition */ struct pptp_addr { __be16 call_id; struct in_addr sin_addr; }; /************************************************************************ * Protocols supported by AF_PPPOX */ #define PX_PROTO_OE 0 /* Currently just PPPoE */ #define PX_PROTO_OL2TP 1 /* Now L2TP also */ #define PX_PROTO_PPTP 2 #define PX_MAX_PROTO 3 struct sockaddr_pppox { sa_family_t sa_family; /* address family, AF_PPPOX */ unsigned int sa_protocol; /* protocol identifier */ union { struct pppoe_addr pppoe; struct pptp_addr pptp; } sa_addr; } __attribute__((packed)); /* The use of the above union isn't viable because the size of this * struct must stay fixed over time -- applications use sizeof(struct * sockaddr_pppox) to fill it. We use a protocol specific sockaddr * type instead. */ struct sockaddr_pppol2tp { sa_family_t sa_family; /* address family, AF_PPPOX */ unsigned int sa_protocol; /* protocol identifier */ struct pppol2tp_addr pppol2tp; } __attribute__((packed)); /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 * bits. So we need a different sockaddr structure. */ struct sockaddr_pppol2tpv3 { sa_family_t sa_family; /* address family, AF_PPPOX */ unsigned int sa_protocol; /* protocol identifier */ struct pppol2tpv3_addr pppol2tp; } __attribute__((packed)); /********************************************************************* * * ioctl interface for defining forwarding of connections * ********************************************************************/ #define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t) #define PPPOEIOCDFWD _IO(0xB1 ,1) /*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/ /* Codes to identify message types */ #define PADI_CODE 0x09 #define PADO_CODE 0x07 #define PADR_CODE 0x19 #define PADS_CODE 0x65 #define PADT_CODE 0xa7 struct pppoe_tag { __be16 tag_type; __be16 tag_len; char tag_data[0]; } __attribute__ ((packed)); /* Tag identifiers */ #define PTT_EOL __cpu_to_be16(0x0000) #define PTT_SRV_NAME __cpu_to_be16(0x0101) #define PTT_AC_NAME __cpu_to_be16(0x0102) #define PTT_HOST_UNIQ __cpu_to_be16(0x0103) #define PTT_AC_COOKIE __cpu_to_be16(0x0104) #define PTT_VENDOR __cpu_to_be16(0x0105) #define PTT_RELAY_SID __cpu_to_be16(0x0110) #define PTT_SRV_ERR __cpu_to_be16(0x0201) #define PTT_SYS_ERR __cpu_to_be16(0x0202) #define PTT_GEN_ERR __cpu_to_be16(0x0203) struct pppoe_hdr { #if defined(__LITTLE_ENDIAN_BITFIELD) __u8 ver : 4; __u8 type : 4; #elif defined(__BIG_ENDIAN_BITFIELD) __u8 type : 4; __u8 ver : 4; #else #error "Please fix " #endif __u8 code; __be16 sid; __be16 length; struct pppoe_tag tag[0]; } __attribute__((packed)); /* Length of entire PPPoE + PPP header */ #define PPPOE_SES_HLEN 8 #endif /* !(__LINUX_IF_PPPOX_H) */ #ifndef _LINUX_PERSONALITY_H #define _LINUX_PERSONALITY_H /* * Flags for bug emulation. * * These occupy the top three bytes. */ enum { ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */ FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors * (signal handling) */ MMAP_PAGE_ZERO = 0x0100000, ADDR_COMPAT_LAYOUT = 0x0200000, READ_IMPLIES_EXEC = 0x0400000, ADDR_LIMIT_32BIT = 0x0800000, SHORT_INODE = 0x1000000, WHOLE_SECONDS = 0x2000000, STICKY_TIMEOUTS = 0x4000000, ADDR_LIMIT_3GB = 0x8000000, }; /* * Security-relevant compatibility flags that must be * cleared upon setuid or setgid exec: */ #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \ ADDR_NO_RANDOMIZE | \ ADDR_COMPAT_LAYOUT | \ MMAP_PAGE_ZERO) /* * Personality types. * * These go in the low byte. Avoid using the top bit, it will * conflict with error returns. */ enum { PER_LINUX = 0x0000, PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT, PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS, PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE, PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE, PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS, PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE, PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS, PER_BSD = 0x0006, PER_SUNOS = 0x0006 | STICKY_TIMEOUTS, PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE, PER_LINUX32 = 0x0008, PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB, PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */ PER_RISCOS = 0x000c, PER_SOLARIS = 0x000d | STICKY_TIMEOUTS, PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, PER_OSF4 = 0x000f, /* OSF/1 v4 */ PER_HPUX = 0x0010, PER_MASK = 0x00ff, }; #endif /* _LINUX_PERSONALITY_H */ /* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * Global definitions for the ARP (RFC 826) protocol. * * Version: @(#)if_arp.h 1.0.1 04/16/93 * * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988 * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source. * Ross Biro * Fred N. van Kempen, * Florian La Roche, * Jonathan Layes * Arnaldo Carvalho de Melo ARPHRD_HWX25 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _LINUX_IF_ARP_H #define _LINUX_IF_ARP_H #include /* ARP protocol HARDWARE identifiers. */ #define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */ #define ARPHRD_ETHER 1 /* Ethernet 10Mbps */ #define ARPHRD_EETHER 2 /* Experimental Ethernet */ #define ARPHRD_AX25 3 /* AX.25 Level 2 */ #define ARPHRD_PRONET 4 /* PROnet token ring */ #define ARPHRD_CHAOS 5 /* Chaosnet */ #define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */ #define ARPHRD_ARCNET 7 /* ARCnet */ #define ARPHRD_APPLETLK 8 /* APPLEtalk */ #define ARPHRD_DLCI 15 /* Frame Relay DLCI */ #define ARPHRD_ATM 19 /* ATM */ #define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */ #define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */ #define ARPHRD_EUI64 27 /* EUI-64 */ #define ARPHRD_INFINIBAND 32 /* InfiniBand */ /* Dummy types for non ARP hardware */ #define ARPHRD_SLIP 256 #define ARPHRD_CSLIP 257 #define ARPHRD_SLIP6 258 #define ARPHRD_CSLIP6 259 #define ARPHRD_RSRVD 260 /* Notional KISS type */ #define ARPHRD_ADAPT 264 #define ARPHRD_ROSE 270 #define ARPHRD_X25 271 /* CCITT X.25 */ #define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ #define ARPHRD_CAN 280 /* Controller Area Network */ #define ARPHRD_PPP 512 #define ARPHRD_CISCO 513 /* Cisco HDLC */ #define ARPHRD_HDLC ARPHRD_CISCO #define ARPHRD_LAPB 516 /* LAPB */ #define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */ #define ARPHRD_RAWHDLC 518 /* Raw HDLC */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel */ #define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */ #define ARPHRD_FRAD 770 /* Frame Relay Access Device */ #define ARPHRD_SKIP 771 /* SKIP vif */ #define ARPHRD_LOOPBACK 772 /* Loopback device */ #define ARPHRD_LOCALTLK 773 /* Localtalk device */ #define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */ #define ARPHRD_BIF 775 /* AP1000 BIF */ #define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */ #define ARPHRD_IPDDP 777 /* IP over DDP tunneller */ #define ARPHRD_IPGRE 778 /* GRE over IP */ #define ARPHRD_PIMREG 779 /* PIMSM register interface */ #define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */ #define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */ #define ARPHRD_ECONET 782 /* Acorn Econet */ #define ARPHRD_IRDA 783 /* Linux-IrDA */ /* ARP works differently on different FC media .. so */ #define ARPHRD_FCPP 784 /* Point to point fibrechannel */ #define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */ #define ARPHRD_FCPL 786 /* Fibrechannel public loop */ #define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */ /* 787->799 reserved for fibrechannel media types */ #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ #define ARPHRD_IEEE802154 804 #define ARPHRD_PHONET 820 /* PhoNet media type */ #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ #define ARPHRD_CAIF 822 /* CAIF media type */ #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ #define ARPHRD_NONE 0xFFFE /* zero header length */ /* ARP protocol opcodes. */ #define ARPOP_REQUEST 1 /* ARP request */ #define ARPOP_REPLY 2 /* ARP reply */ #define ARPOP_RREQUEST 3 /* RARP request */ #define ARPOP_RREPLY 4 /* RARP reply */ #define ARPOP_InREQUEST 8 /* InARP request */ #define ARPOP_InREPLY 9 /* InARP reply */ #define ARPOP_NAK 10 /* (ATM)ARP NAK */ /* ARP ioctl request. */ struct arpreq { struct sockaddr arp_pa; /* protocol address */ struct sockaddr arp_ha; /* hardware address */ int arp_flags; /* flags */ struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ char arp_dev[16]; }; struct arpreq_old { struct sockaddr arp_pa; /* protocol address */ struct sockaddr arp_ha; /* hardware address */ int arp_flags; /* flags */ struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ }; /* ARP Flag values. */ #define ATF_COM 0x02 /* completed entry (ha valid) */ #define ATF_PERM 0x04 /* permanent entry */ #define ATF_PUBL 0x08 /* publish entry */ #define ATF_USETRAILERS 0x10 /* has requested trailers */ #define ATF_NETMASK 0x20 /* want to use a netmask (only for proxy entries) */ #define ATF_DONTPUB 0x40 /* don't answer this addresses */ /* * This structure defines an ethernet arp header. */ struct arphdr { __be16 ar_hrd; /* format of hardware address */ __be16 ar_pro; /* format of protocol address */ unsigned char ar_hln; /* length of hardware address */ unsigned char ar_pln; /* length of protocol address */ __be16 ar_op; /* ARP opcode (command) */ #if 0 /* * Ethernet looks like this : This bit is variable sized however... */ unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */ unsigned char ar_sip[4]; /* sender IP address */ unsigned char ar_tha[ETH_ALEN]; /* target hardware address */ unsigned char ar_tip[4]; /* target IP address */ #endif }; #endif /* _LINUX