2 * Copyright (C) 2002 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
6 #ifndef __UM_VECTOR_USER_H
7 #define __UM_VECTOR_USER_H
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)
27 #define IPPROTO_GRE 0x2F
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 */
42 #define IPPROTO_L2TP 0x73
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
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(
71 struct arglist
*parsed
74 extern char *uml_vector_fetch_arg(
75 struct arglist
*ifspec
,
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(
87 extern int uml_vector_recvmmsg(
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
);