-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlk_onload_stub_ext.h
67 lines (57 loc) · 2.07 KB
/
lk_onload_stub_ext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright 2023 Google LLC
*
* 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.
*
* 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.
*/
/* lk_onload_stub_ext
*
* For regression tests only. Not intended to be used directly.
*
* Exports symbols so that test binary can build and link.
* The test then uses LD_PRELOAD with ld_onload_stub to get the
* "real" (stub) implementation.
*
* Therefore all functions here return with error.
*/
#include <time.h>
#ifdef HAVE_ONLOAD
#include <onload/extensions.h>
#else
/* Linux TCP ignores flags it does not expect.
* It is safe to pass this flag to a tcp socket recv call.
*
* This flag does alias a flag in Linux: MSG_SENDPAGE_NOTLAST.
* Introduced in v3.4 in commit 35f9c09fe9c7
* ("tcp: tcp_sendpages() should call tcp_push() once")
* That flag is internal to Linux and only used in sendpage.
*/
#define ONLOAD_MSG_ONEPKT 0x20000
struct onload_ordered_epoll_event {
struct timespec ts;
int bytes;
};
int onload_ordered_epoll_wait(int epfd, struct epoll_event *events,
struct onload_ordered_epoll_event *oo_events,
int maxevents, int timeout);
/* Stacks API */
int onload_move_fd(int fd);
int onload_set_stackname(int who, int scope, const char* stackname);
int onload_stackname_restore(void);
int onload_stackname_save(void);
int onload_stack_opt_get_int(const char* opt, int64_t *val);
int onload_stack_opt_get_str(const char* opt, char* val_out, size_t* val_out_len);
int onload_stack_opt_reset(void);
int onload_stack_opt_set_int(const char* opt, int64_t val);
int onload_stack_opt_set_str(const char* opt, const char* val);
/* non-accel API */
int onload_fd_stat(int fd, void *unused);
int onload_is_present(void);
int onload_socket_nonaccel(int domain, int type, int protocol);
#endif