![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux network
文章平均质量分 76
安静呆一会儿
这个作者很懒,什么都没留下…
展开
-
tcp-ip : net_device structure
The net_device struct represents the network device. It can be a physical device, like an Ethernet device, or it can be a software device, like a bridge device or a VLAN device.[include/linux/netdev原创 2015-03-04 15:56:50 · 1527 阅读 · 0 评论 -
gcc嵌入汇编
格式:__asm__ __volatile__ (汇编语句: 输出: 输入: 将要修改的寄存器);标志:“=”:输出“r”:任一通用寄存器“g”:让编译器决定如何装入它“0”~“9”:指定一个操作数,它既做输入又做输出命令:addl : 加法adcl : 带进位加法原创 2015-03-04 10:24:30 · 437 阅读 · 0 评论 -
网络模块初始化-net成员
在net中有很多成员,这些都是全局量,它们的初始化在不同的函数进行实现:[ net/core/net_namespace.c ]static struct pernet_operations __net_initdata netdev_net_ops = { .init = netdev_init, .exit = netdev_exit,};/* Initialize pe原创 2015-01-16 10:11:03 · 1247 阅读 · 0 评论 -
网络模块初始化-packet_type
当设备接收到一个包,会从类型字段得到协议类型,如:IP,802.3,ARP,IPv6等。然后根据类型,调用不同的处理函数,这类似面向对象的操作通过下面的方式实现:定义一个结构,用来将类型和函数对应起来[ include/linux/netdevice.h ]struct packet_type { __be16 type; /* This is really htons(et原创 2015-01-14 16:44:51 · 1253 阅读 · 0 评论 -
tcp-ip Encapsulation
Each layer adds information to the data by prepending headers (and sometimes adding trailer information) to the data that it receives.The unit of data that TCP sends to IP is called a TCP segment. The原创 2014-12-25 14:45:53 · 644 阅读 · 0 评论 -
tcp-ip Introduction
Networking protocols are normally developed in layers, with each layer responsible for a different facet of the communications. A protocol suite, such as TCP/IP, is the combination of different protoc原创 2014-12-25 13:22:36 · 354 阅读 · 0 评论 -
网络模块初始化-net( 网络名字空间 )
[ include/net/net_namespace.h ]Some of the currently global variables in the network stack need to have one instance per network namespace,or the global data structure needs to have a network name原创 2015-01-07 15:42:13 · 886 阅读 · 0 评论 -
Frame Reception
Enabling and Disabling a Device原创 2014-07-31 15:41:47 · 552 阅读 · 0 评论 -
代码
普通的iterator server and client原创 2014-12-09 16:54:49 · 312 阅读 · 0 评论 -
tcp-ip : sk_buff Structure
The sk_buff structure represents a packet. SKB stands for socket buffer. A packet can be generated by a local socket in the local machine, which was created by a userspace application; the packet can原创 2015-03-05 10:34:22 · 1153 阅读 · 0 评论 -
Netlink Sockets
The netlink socket interface( AF_NETLINK socket ) was created as a more flexible alternative to the awkward IOCTL communication method between userspace processes and the kernel. The IOCTL handlers ca原创 2015-03-05 13:10:48 · 448 阅读 · 0 评论 -
rfc791 IP协议
简介目的在网络中,IP协议被用来从源主机向目的主机传送数据包。网络中的主机用固定长度的地址来标识。由于硬件限制,网络中只能通过有限大小的数据包,IP提供分片和重组功能来传输大的数据包。范围IP协议只提供传送数据所需的必要功能。至于可靠性,流量控制等功能都由上层协议提供。接口端对端协议调用IP协议,IP协议调用本机网络协议(如以太网协议)将数据包发送到目的主机或网关。 如:TCP模块要传输一个TCP翻译 2015-05-18 09:39:54 · 3547 阅读 · 1 评论 -
lamp配置
[/opt/lampp/etc/extra/httpd-xampp.conf]## New XAMPP security concept#<LocationMatch ...> Require local ...</LocationMatch>当中的Require local改为Require all granted原创 2015-05-18 08:58:54 · 457 阅读 · 0 评论 -
正则表达式
元字符:在正则表达式中有特殊含义的字符,如:. ? ^ 行开头的位置 $ 行结束的位置 这两个只是匹配行中的位置,并不匹配任何字符。 当开启多行模式时,可以匹配多行 [] 匹配一个字符,此字符列在这里:如[ab]表示匹配一个字符,此字符是a或b 可以用-表示范围:如[0-2]等价于[012],[a-c]等价于[abc],[0-2a-c]等价于[012abc]原创 2015-06-18 10:36:14 · 706 阅读 · 0 评论 -
ip_route_output_flow
[ip_route_output_flow]struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4, struct sock *sk){ struct rtable *rt = __ip_route_output_key(net, flp4);[connect-原创 2015-04-23 16:59:41 · 3190 阅读 · 0 评论 -
SYSCALL_DEFINE2(listen, int, fd, int, backlog)
[listen]SYSCALL_DEFINE2(listen, int, fd, int, backlog){ struct socket *sock; int err, fput_needed; int somaxconn; sock = sockfd_lookup_light(fd, &err, &fput_needed); if (sock) { somaxconn =原创 2015-04-20 10:27:39 · 881 阅读 · 1 评论 -
SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
[bind]SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen){ struct socket *sock; int err, fput_needed; sock = sockfd_lookup_light(fd, &err, &fput_needed);从文件fd中得到对应的原创 2015-04-21 15:19:12 · 783 阅读 · 0 评论 -
sock_init
[net/socket.c ]static struct vfsmount *sock_mnt __read_mostly;可以把sock_mnt当作socket文件系统的虚拟挂载点。内核将socket实现为一个虚拟文件系统,和一般文件系统的不同之处在于它没有挂载点,不能通过mount命令进行挂载。/* the kern_mount function is called which “m原创 2015-04-15 09:19:42 · 1366 阅读 · 0 评论 -
int socket( int family, int type, int,protocol)
[net/socket.c]SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol){ int retval; struct socket *sock; int flags; flags = type & ~SOCK_TYPE_MASK; if (flags & ~(SOCK_CLOEXEC | SOCK_NON原创 2015-04-16 16:20:16 · 1070 阅读 · 0 评论 -
Device Registration and Initialization
When a Device Is RegisteredLoading an NIC’s device driverAn NIC’s device driver is initialized at boot time if it is built into the kernel, andat runtime if it is loaded as a module. Whenever in原创 2014-07-22 16:44:58 · 371 阅读 · 0 评论 -
工具
cscope 生成索引:进入源码目录原创 2014-08-16 15:40:48 · 282 阅读 · 0 评论 -
Network Implementation Overview
DescriptorsA descriptor is an index into an array within the process table entry for the process. This array entrypoints to an open file table structure, which in turn points to an i-node or v-nod原创 2014-07-15 10:35:34 · 1110 阅读 · 0 评论 -
Interface Layer
The interface layer supports provides for all devices:原创 2014-07-15 16:52:03 · 653 阅读 · 0 评论 -
Name and Address Conversions
Domain Name System (DNS)The DNS is used primarily to map between hostnames and IP addresses.原创 2014-06-25 10:46:24 · 659 阅读 · 0 评论 -
线程
fork 的问题:效率不高。内存要从父fj原创 2014-04-25 11:05:30 · 431 阅读 · 0 评论 -
Mbufs: Memory Buffers
The main use of mbufs is to hold the user data that travels from the process to the network interface, and vice versa. But mbufs are also used to contain a variety of other miscellaneous data: source原创 2014-07-15 14:59:00 · 1504 阅读 · 0 评论 -
Notification Chains
The kernel exports internal information to user space via different interfaces. Besides the classic set of system calls the application programmer can use to ask for specific information, there are th原创 2014-07-21 13:51:18 · 370 阅读 · 0 评论 -
进程,信号
#include struct sigaction原创 2014-05-15 17:03:05 · 519 阅读 · 0 评论 -
Building and Running Modules
#include #include MODULE_LICENSE("Dual BSD/GPL");static int hello_init(void){printk(KERN_ALERT "Hello, world\n");return 0;}static void hello_exit(void){printk(KERN_ALERT "Goodbye, cruel worl原创 2014-08-18 13:30:50 · 412 阅读 · 0 评论 -
net_device
The net_device data structure stores all information specifically regarding a network device.There is one such structure for each device, both real ones (such as Ethernet NICs) and virtual ones (such原创 2014-07-21 10:38:39 · 895 阅读 · 0 评论 -
hlist_head
include/linux/types.hstruct hlist_head { struct hlist_node *first;};struct hlist_node { struct hlist_node *next, **pprev;};原创 2014-10-28 16:03:03 · 491 阅读 · 0 评论 -
Kernel Infrastructure for Component Initialization
Boot-Time Kernel Optionsparse_args is a routine that parses an input string with parameters in the form name_variable=value, looking for specific keywords and invoking the right handlers. parse_原创 2014-07-22 16:25:13 · 478 阅读 · 0 评论 -
System Startup
The moment after a computer is powered on, it is practically useless because theRAM chips contain random data and no operating system is running. To begin theboot, a special hardware circuit raise原创 2014-07-25 15:00:27 · 1169 阅读 · 0 评论 -
net_device
struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, void (*setup)(struct net_device *), unsigned int txqs, unsigned int rxqs){ struct net_device *dev; size_t alloc_size; str原创 2014-09-24 16:04:19 · 884 阅读 · 0 评论 -
sk_buff
位置:include/linux/skbuff.h原创 2014-09-02 09:08:17 · 3408 阅读 · 0 评论