perf tools: Don't clone maps from parent when synthesizing forks
[linux/fpc-iii.git] / arch / um / drivers / vector_user.h
blobd7cbff73b7ff2ffad826be45aeba724b67a0eb58
1 /*
2 * Copyright (C) 2002 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
6 #ifndef __UM_VECTOR_USER_H
7 #define __UM_VECTOR_USER_H
9 #define MAXVARGS 20
11 #define TOKEN_IFNAME "ifname"
13 #define TRANS_RAW "raw"
14 #define TRANS_RAW_LEN strlen(TRANS_RAW)
16 #define TRANS_TAP "tap"
17 #define TRANS_TAP_LEN strlen(TRANS_TAP)
20 #define TRANS_GRE "gre"
21 #define TRANS_GRE_LEN strlen(TRANS_RAW)
23 #define TRANS_L2TPV3 "l2tpv3"
24 #define TRANS_L2TPV3_LEN strlen(TRANS_L2TPV3)
26 #ifndef IPPROTO_GRE
27 #define IPPROTO_GRE 0x2F
28 #endif
30 #define GRE_MODE_CHECKSUM cpu_to_be16(8 << 12) /* checksum */
31 #define GRE_MODE_RESERVED cpu_to_be16(4 << 12) /* unused */
32 #define GRE_MODE_KEY cpu_to_be16(2 << 12) /* KEY present */
33 #define GRE_MODE_SEQUENCE cpu_to_be16(1 << 12) /* sequence */
35 #define GRE_IRB cpu_to_be16(0x6558)
37 #define L2TPV3_DATA_PACKET 0x30000
39 /* IANA-assigned IP protocol ID for L2TPv3 */
41 #ifndef IPPROTO_L2TP
42 #define IPPROTO_L2TP 0x73
43 #endif
45 struct arglist {
46 int numargs;
47 char *tokens[MAXVARGS];
48 char *values[MAXVARGS];
51 /* Separating read and write FDs allows us to have different
52 * rx and tx method. Example - read tap via raw socket using
53 * recvmmsg, write using legacy tap write calls
56 struct vector_fds {
57 int rx_fd;
58 int tx_fd;
59 void *remote_addr;
60 int remote_addr_size;
63 #define VECTOR_READ 1
64 #define VECTOR_WRITE (1 < 1)
65 #define VECTOR_HEADERS (1 < 2)
67 extern struct arglist *uml_parse_vector_ifspec(char *arg);
69 extern struct vector_fds *uml_vector_user_open(
70 int unit,
71 struct arglist *parsed
74 extern char *uml_vector_fetch_arg(
75 struct arglist *ifspec,
76 char *token
79 extern int uml_vector_recvmsg(int fd, void *hdr, int flags);
80 extern int uml_vector_sendmsg(int fd, void *hdr, int flags);
81 extern int uml_vector_writev(int fd, void *hdr, int iovcount);
82 extern int uml_vector_sendmmsg(
83 int fd, void *msgvec,
84 unsigned int vlen,
85 unsigned int flags
87 extern int uml_vector_recvmmsg(
88 int fd,
89 void *msgvec,
90 unsigned int vlen,
91 unsigned int flags
93 extern void *uml_vector_default_bpf(int fd, void *mac);
94 extern int uml_vector_attach_bpf(int fd, void *bpf, int bpf_len);
95 extern bool uml_raw_enable_qdisc_bypass(int fd);
96 extern bool uml_raw_enable_vnet_headers(int fd);
97 extern bool uml_tap_enable_vnet_headers(int fd);
100 #endif