~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/um/drivers/vector_user.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (C) 2002 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  4  */
  5 
  6 #ifndef __UM_VECTOR_USER_H
  7 #define __UM_VECTOR_USER_H
  8 
  9 #define MAXVARGS        20
 10 
 11 #define TOKEN_IFNAME "ifname"
 12 
 13 #define TRANS_RAW "raw"
 14 #define TRANS_RAW_LEN strlen(TRANS_RAW)
 15 
 16 #define TRANS_TAP "tap"
 17 #define TRANS_TAP_LEN strlen(TRANS_TAP)
 18 
 19 #define TRANS_GRE "gre"
 20 #define TRANS_GRE_LEN strlen(TRANS_GRE)
 21 
 22 #define TRANS_L2TPV3 "l2tpv3"
 23 #define TRANS_L2TPV3_LEN strlen(TRANS_L2TPV3)
 24 
 25 #define TRANS_HYBRID "hybrid"
 26 #define TRANS_HYBRID_LEN strlen(TRANS_HYBRID)
 27 
 28 #define TRANS_BESS "bess"
 29 #define TRANS_BESS_LEN strlen(TRANS_BESS)
 30 
 31 #define DEFAULT_BPF_LEN 6
 32 
 33 #ifndef IPPROTO_GRE
 34 #define IPPROTO_GRE 0x2F
 35 #endif
 36 
 37 #define GRE_MODE_CHECKSUM       cpu_to_be16(8 << 12)    /* checksum */
 38 #define GRE_MODE_RESERVED       cpu_to_be16(4 << 12)    /* unused */
 39 #define GRE_MODE_KEY            cpu_to_be16(2 << 12)    /* KEY present */
 40 #define GRE_MODE_SEQUENCE       cpu_to_be16(1 << 12)    /* sequence */
 41 
 42 #define GRE_IRB cpu_to_be16(0x6558)
 43 
 44 #define L2TPV3_DATA_PACKET 0x30000
 45 
 46 /* IANA-assigned IP protocol ID for L2TPv3 */
 47 
 48 #ifndef IPPROTO_L2TP
 49 #define IPPROTO_L2TP 0x73
 50 #endif
 51 
 52 struct arglist {
 53         int     numargs;
 54         char    *tokens[MAXVARGS];
 55         char    *values[MAXVARGS];
 56 };
 57 
 58 /* Separating read and write FDs allows us to have different
 59  * rx and tx method. Example - read tap via raw socket using
 60  * recvmmsg, write using legacy tap write calls
 61  */
 62 
 63 struct vector_fds {
 64         int rx_fd;
 65         int tx_fd;
 66         void *remote_addr;
 67         int remote_addr_size;
 68 };
 69 
 70 #define VECTOR_READ     1
 71 
 72 extern struct arglist *uml_parse_vector_ifspec(char *arg);
 73 
 74 extern struct vector_fds *uml_vector_user_open(
 75         int unit,
 76         struct arglist *parsed
 77 );
 78 
 79 extern char *uml_vector_fetch_arg(
 80         struct arglist *ifspec,
 81         char *token
 82 );
 83 
 84 extern int uml_vector_recvmsg(int fd, void *hdr, int flags);
 85 extern int uml_vector_sendmsg(int fd, void *hdr, int flags);
 86 extern int uml_vector_writev(int fd, void *hdr, int iovcount);
 87 extern int uml_vector_sendmmsg(
 88         int fd, void *msgvec,
 89         unsigned int vlen,
 90         unsigned int flags
 91 );
 92 extern int uml_vector_recvmmsg(
 93         int fd,
 94         void *msgvec,
 95         unsigned int vlen,
 96         unsigned int flags
 97 );
 98 extern void *uml_vector_default_bpf(const void *mac);
 99 extern void *uml_vector_user_bpf(char *filename);
100 extern int uml_vector_attach_bpf(int fd, void *bpf);
101 extern int uml_vector_detach_bpf(int fd, void *bpf);
102 extern bool uml_raw_enable_qdisc_bypass(int fd);
103 extern bool uml_raw_enable_vnet_headers(int fd);
104 extern bool uml_tap_enable_vnet_headers(int fd);
105 
106 
107 #endif
108 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php