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