1.流式套接字(SOCKET_STREAM)
2.数据报式套接字(SOCKET_DGRAM)
3.原始式套接字(SOCKET_RAW)
二 基本套接字系统调有有如下一些:
三 数据类型
四 常用函数
-----------------------------------
netinet/if_ether.h
netinet/ether.h
netinet/ip.h
linux/ip.h
linux/if.h
linux/if_packet.h
netinet/in.h
netdb.h
net/bpf.h
net/ethernet.h 包括几个以太网的数据结构,ether_addr(mac帧结构),ether_header(以太帧的头部)
-------------------------------
<sys/types.h>
<sys/socket.h>
<sys/ioctl.h>
<stdlib.h>
<netdb.h>
<arpa/inet.h>
<netinet/in.h>
------------------------------
linux下socket编写常用头文件
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <poll.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netdb.h>
#include <error.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <string>
#include <iostream>
1万+




被折叠的 条评论
为什么被折叠?



