Using the socket BPF

Source: Internet
Author: User

Using the socket BPF

Note (the content described in this article):

In addition, the problem with this BPF code is that, in general, tcpdump only returns the first 96 bytes of the captured packet, which is the 0x60 byte, and the second-to-last line of the visible code is the RET #96. For a complete package processing or not, so you need to set it to 0x0000ffff, or when using tcpdump generated with Tcpdump-s 65535-dd ... To generate

1, my tcpdump generated BPF code, the length is directly 0x0000ffff rather than 0x60, may be related to the tcpdump version

[[Email Protected] NFS] #/tcpdump UDP-DD device eth0 entered promiscuous mode{0x28, 0, 0, 0x0000000cdevice eth0 left P romiscuous mode},{0x15, 0, 5, 0x000086dd},{0x30, 0, 0, 0x00000014},{0x15, 6, 0, 0x00000011},{0x15, 0, 6, 0x0000002  C},{0x30, 0, 0, 0x00000036},{0x15, 3, 4, 0x00000011},{0x15, 0, 3, 0x00000800},{0x30, 0, 0, 0x00000017},{0x15, 0, 1, 0x00000011},{0x6, 0, 0, 0x0000ffff},{0x6, 0, 0, 0x00000000},[[email protected] NFS] #./TCPDUMP-DD ether Proto 0 X8033device Eth0 entered promiscuous mode{0x28, 0, 0, 0xdevice eth0 left promiscuous mode0000000c},{0x15, 0, 1, 0x00008 033},{0x6, 0, 0, 0x0000ffff},{0x6, 0, 0, 0x00000000},[[email protected] NFS] #./tcpdump--help                ./tcpdump:invali d option---tcpdump version 4.5.1libpcap version 1.5.2

BPF (BSD Packet Filter)-Application and concept extensions

Using socket BPF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.