xref: /f-stack/app/micro_thread/ff_hook.h (revision c36e692a)
1 
2 /**
3  * Tencent is pleased to support the open source community by making MSEC available.
4  *
5  * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
6  *
7  * Licensed under the GNU General Public License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License. You may
9  * obtain a copy of the License at
10  *
11  *     https://opensource.org/licenses/GPL-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software distributed under the
14  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language governing permissions
16  * and limitations under the License.
17  */
18 
19 
20 #ifndef __FF_HOOK_H__
21 #define __FF_HOOK_H__
22 
23 #include <stdint.h>
24 
25 int ff_hook_socket(int domain, int type, int protocol);
26 int ff_hook_close(int fd);
27 
28 int ff_hook_connect(int fd, const struct sockaddr *address, socklen_t addrlen_len);
29 
30 ssize_t ff_hook_read(int fd, void *buf, size_t nbyte);
31 
32 ssize_t ff_hook_write(int fd, const void *buf, size_t nbyte);
33 ssize_t ff_hook_sendto(int fd, const void *message, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t dest_len);
34 ssize_t ff_hook_recvfrom(int fd, void *buffer, size_t length, int flags, struct sockaddr *address, socklen_t *address_len);
35 ssize_t ff_hook_recv(int fd, void *buffer, size_t length, int flags);
36 ssize_t ff_hook_send(int fd, const void *buf, size_t nbyte, int flags);
37 int ff_hook_setsockopt(int fd, int level, int option_name, const void *option_value, socklen_t option_len);
38 int ff_hook_ioctl(int fd, int cmd, void *arg);
39 
40 int ff_hook_fcntl(int fd, int cmd, void *arg);
41 
42 int ff_hook_listen(int fd, int backlog);
43 
44 int ff_hook_bind(int fd, const struct sockaddr *addr, socklen_t addrlen);
45 int ff_hook_accept(int fd, struct sockaddr *addr, socklen_t *addrlen);
46 
47 #endif
48 
49