1a624b1fae
merge 9d90e00(F3 sink 往返喂位)后 @build 0/0 重编:Code=224,860 / ER_IROM1 249,488 / RW=1,332 / ZI=135,100,lane-f 申报(+92B、RAM 79,008) 一致;凭证重盖、内存两账回填、覆盖率基线含新 ui_sink 套(39→40 套, AGENTS 单测计数 22→23 同步)。stub 五头的空白/末行改动为格式钩子 (trailing-whitespace / end-of-file-fixer)在合并现场落笔,非语义变化。
46 lines
1.2 KiB
C
46 lines
1.2 KiB
C
#ifndef NET_SOCKET_H
|
|
#define NET_SOCKET_H
|
|
|
|
/*
|
|
* 主机侧桩(test/host/ui_sink):镜像真实 Drivers/BSP/NET/net_socket.h 中
|
|
* ui_net_sink.c 用到的 API 面(签名逐字一致),实现由测试文件提供假件。
|
|
*/
|
|
#include <stdint.h>
|
|
|
|
#define NET_AF_INET 2
|
|
#define NET_SOCK_STREAM 1
|
|
#define NET_INADDR_ANY 0u
|
|
#define NET_ERR_WOULDBLOCK 11
|
|
|
|
struct net_sockaddr {
|
|
unsigned short sa_family;
|
|
char sa_data[14];
|
|
};
|
|
|
|
struct net_in_addr {
|
|
unsigned long s_addr;
|
|
};
|
|
|
|
struct net_sockaddr_in {
|
|
short sin_family;
|
|
unsigned short sin_port;
|
|
struct net_in_addr sin_addr;
|
|
char sin_zero[8];
|
|
};
|
|
|
|
uint32_t net_get_generation(void);
|
|
uint16_t net_htons(uint16_t hostshort);
|
|
int net_socket(int domain, int type);
|
|
int net_bind(int sockfd, const struct net_sockaddr *addr, int addrlen);
|
|
int net_listen(int sockfd);
|
|
int net_accept(int sockfd, struct net_sockaddr *addr, int *addrlen);
|
|
int net_listener_armed(int sockfd);
|
|
int net_can_read(int sockfd);
|
|
int net_send(int sockfd, const void *buf, int len, int flags);
|
|
int net_recv_nb(int sockfd, void *buf, int len);
|
|
int net_close(int sockfd);
|
|
int net_get_errno(void);
|
|
void *net_get_sock(int sockfd);
|
|
|
|
#endif /* NET_SOCKET_H */
|