-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from mengdemao/feature/socket
feat(socket): 合并socket分支改动
- Loading branch information
Showing
19 changed files
with
435 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @file lazybsd_api.cc | ||
* @author mengdemao (mengdemao19951021@gmail.com) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2024-05-22 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,49 @@ | ||
#include <lazybsd_api.h> | ||
/** | ||
* @file lazybsd_api.hh | ||
* @author mengdemao (mengdemao19951021@gmail.com) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2024-05-20 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ | ||
#include "lazybsd_api.h" | ||
|
||
#ifndef __LAZYBSD_API_HXX__ | ||
#define __LAZYBSD_API_HXX__ | ||
|
||
int lazybsd_init(int argc, char * const argv[]); | ||
|
||
void lazybsd_run(loop_func_t loop, void *arg); | ||
|
||
/* Tests if fd is used by F-Stack */ | ||
extern int lazybsd_fdisused(int fd); | ||
|
||
extern int lazybsd_getmaxfd(void); | ||
|
||
/* | ||
* Get traffic for QoS or other via API. | ||
* The size of buffer must >= siezof(struct lazybsd_traffic_args), now is 32 bytes. | ||
*/ | ||
void lazybsd_get_traffic(void *buffer); | ||
|
||
/* | ||
* On success, 0 is returned. | ||
* On error, -1 is returned, and errno is set appropriately. | ||
*/ | ||
int lazybsd_route_ctl(enum LAZYBSD_ROUTE_CTL req, enum LAZYBSD_ROUTE_FLAG flag, | ||
struct linux_sockaddr *dst, struct linux_sockaddr *gw, | ||
struct linux_sockaddr *netmask); | ||
|
||
/* regist a packet dispath function */ | ||
void lazybsd_regist_packet_dispatcher(dispatch_func_t func); | ||
|
||
int lazybsd_fcntl(int fd, int cmd, ...); | ||
|
||
int lazybsd_sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, | ||
const void *newp, size_t newlen); | ||
|
||
int lazybsd_ioctl(int fd, unsigned long request, ...); | ||
|
||
#endif // __LAZYBSD_API_HXX__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @file lazybsd_epoll.hh | ||
* @author mengdemao (mengdemao19951021@gmail.com) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2024-05-28 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ |
Oops, something went wrong.