勤学似春起之苗,不见其增,日有所长; 辍学如磨刀之石,不见其损,日所有亏!


[翻译]Understanding Linux Network Internals--Chapter 2. Critical Data Structures


Chapter 2. Critical Data Structures 重要的数据结构

A few key data structures are referenced throughout the Linux networking code. Both when reading this book and when studying the source code directly, you'll need to understand the fields in these data structures. To be sure, going over data structures field by field is less fun than unraveling functions, but it's an important foundation to have. "Show me your data," said the legendary software engineer, Frederick P. Brooks.

只有少量的关键数据结构在Linux网络代码中使用。不管是阅读本书,还是直接学习源代码,你都有必要理解这些结构里的字段。固然,仔细查看数据结构里的字段比展开函数要无聊的多,但这是重要的且必须了解的基础知识。传奇的软件工程师Frederick P. Brooks就说过:“Show me the data,”(译注:让我想起show me the money. 呵呵)

This chapter introduces the following data structures, and mentions some of the functions and macros that manipulate them:


struct sk_buff

This is where a packet is stored. The structure is used by all the network layers to store their headers, information about the user data (the payload), and other information needed internally for coordinating their work.

struct net_device

Each network device is represented in the Linux kernel by this data structure, which contains information about both its hardware and its software configuration. See Chapter 8 for details on when and how net_device data structures are allocated.

Another critical data structure for Linux networking is struct sock, which stores the networking information for sockets. Because this book does not cover sockets, I have not included sock in this chapter.


 (=^o^=)  Wu.Country@侠缘      
 (~)@(~)  一辈子,用心做一件事!

posted on 2008-11-15 23:39  Wu.Country@侠缘  阅读(844)  评论(0编辑  收藏  举报