Processing Program for receiving Ethernet frames in Linux Kernel

Source: Internet
Author: User
The Linux kernel receives the Ethernet frame processing program-general Linux technology-Linux programming and kernel information. The following is a detailed description. 1. Preface

In addition to the 6-byte destination MAC address and 6-byte source MAC address, the Ethernet frame type value of the two bytes also exists in the Ethernet header, for example, IPv4 is 0x0800, ARP is 0x0806, etc, after the NIC driver receives the Ethernet frame, it uses the interface function netif_receive_skb () (netif_rx actually calls netif_receive_skb) to deliver it to the upper layer, and this interface function completes the distinction between the Ethernet frame types, deliver to different protocol handlers. If you want to write a processing program for an Ethernet frame, you need to add the corresponding code. The following is the Linux kernel 2.6 code.

2. Data Structure

Each protocol must define a packet_type structure, which leads to relevant protocol data processing functions. All nodes form a linked list (HASH linked list ).
QUOTE:
Related Article

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.