免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4033 | 回复: 0
打印 上一主题 下一主题

市面好像没有书介绍到sockaddr_ll啊? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-23 11:19 |只看该作者 |倒序浏览
为啥这些内容没有一本书提到:
sockaddr_ll 这个类型,在UNP,begin linux programming,GNU/Linux Application Programming中都找不到..
是因为来不及更新吗?

UNP也只是介绍了pcap-对PF_pACKET的封装

man packet

PACKET(7)           Linux Programmer's Manual           PACKET(7)



NAME
       packet, PF_PACKET - packet interface on device level.

SYNOPSIS
       #include <sys/socket.h>
       #include <netpacket/packet.h>
       #include <net/ethernet.h>     /* the L2 protocols */

       packet_socket = socket(PF_PACKET, int socket_type, int protocol);

DESCRIPTION
       Packet sockets are used to receive or send raw packets at the device driver (OSI Layer 2) level. They allow the user to implement protocol modules in user space on top of the physical layer.

       The  socket_type  is either SOCK_RAW for raw packets including the link level header or SOCK_DGRAM for cooked packets with the link level header removed. The link level header information is available in a common format in a
       sockaddr_ll.  protocol is the IEEE 802.3 protocol number in network order. See the <linux/if_ether.h> include file for a list of allowed protocols. When protocol is set to htons(ETH_P_ALL) then all  protocols  are  received.
       All incoming packets of that protocol type will be passed to the packet socket before they are passed to the protocols implemented in the kernel.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP