自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

hhhhhyyyyy8的博客

记录而已

  • 博客(223)
  • 收藏
  • 关注

原创 MATLAB练习

colormap parulacolorbarhelp elfunhelp elmat[X,Y] = meshgrid(-8:.5:8);R = sqrt(X.^2 + Y.^2) + eps;Z = sin(R)./R;surf(X,Y,Z,'FaceColor','red','EdgeColor','none')camlight left; lighting phong

2021-10-03 20:20:50 434

原创 2021-03-20

helloworld:pip、Django、python helloworld.py runserver 127.0.0.1:8000

2021-03-20 09:29:13 354

转载 从udp_sendmsg到ip_output发包过程

UDP socket在传输层调用的发送函数为udp_sendmsg,这个函数内容好多。参考:https://blog.packagecloud.io/eng/2017/02/06/monitoring-tuning-linux-networking-stack-sending-data/#udp_sendmsghttp://arthurchiao.art/blog/tuning-stack-tx-zh/#chap_5.1http://blog.chinaunix.net/uid-145288

2020-06-06 17:41:05 1923

转载 linux netlink通信机制

转载自:https://blog.csdn.net/stone8761/article/details/72780863https://www.cnblogs.com/wenqiang/p/6306727.htmluser_msghdr结构体,就是用户层的msghdr结构体。E:\linux-4.1.45\linux-4.1.45\include\linux\socket.hstruct user_msghdr { void __user *msg_name; /* ptr to soc

2020-06-05 16:43:29 334

原创 sendmsg系统调用

sendmsg系统调用,主要工作是将用户空间的消息头复制到内核空间中,对消息头进行检查。最后逐级调用发包接口发送数据。SYSCALL_DEFINE3(sendmsg, int, fd, struct user_msghdr __user *, msg, unsigned int, flags)E:\linux-4.1.45\linux-4.1.45\net\socket.cSYSCALL_DEFINE3(sendmsg, int, fd, struct user_msghdr __user *.

2020-06-05 11:29:29 3169

原创 socket系统调用-文件相关

sock_map_fd()获取文件描述符,创建file结构实例;socket与file绑定,将file结构添加到进程打开的文件指针数组中。寻思着,根据fd,找到file;根据file找到socket。E:\linux-4.1.45\linux-4.1.45\net\socket.cstatic int sock_map_fd(struct socket *sock, int flags){ struct file *newfile; int fd = get_unused_fd_fla

2020-06-03 20:20:40 444

原创 待会再起

socket虽然也属于VFS的管辖范围,但是有其独特性,不能像打开大部分文件系统下的文件一样打开socket,它只能被创建。VFS是物理文件系统与服务之间的一个接口层,它对Linux的每个文件系统的所有细节进行抽象,使得不同的文件系统在Linux上看起来都是相同的。严格地说,VFS并不是一种实际的文件系统,它只存在于内存中,不存在于任何外存空间,VFS在系统启动时建立,在系统关闭时消亡。用户只能与VFS打交道,不能直接访问实际的文件系统,例如EXT2、EXT3、PROC。...

2020-06-03 13:10:26 151

原创 网络IO模型

同步IO与异步IO阻塞IOsocket默认是阻塞的非阻塞IOIO多路复用select:监控多个socket后面找个例子敲敲select (基本被淘汰)监听的socket个数有限;循环扫描监听,socket个数越多,性能越低。信号驱动IO异步IO...

2020-06-02 18:00:55 138

原创 What are the differences between iputils-ping and inetutils-ping?

今天无意发现iputils、inetutils两个包中都有ping命令,区别在哪里?下面这个网址中的回答很好。https://unix.stackexchange.com/questions/400351/what-are-the-differences-between-iputils-ping-and-inetutils-ping我自己电脑中的ping命令是iputils包中的:...

2020-06-01 22:00:31 1631

转载 lsof

先mark一下https://www.cnblogs.com/sparkbj/p/7161669.htmlhttps://linux.cn/article-4099-1.htmlhttps://www.jianshu.com/p/a3aa6b01b2e1https://blog.51cto.com/zhangxinqi/2374118

2020-06-01 11:18:12 507

转载 ethtool

先mark一下。https://blog.csdn.net/u011857683/article/details/83758689https://www.cnblogs.com/xf-linux-arm-java-android/p/3742720.htmlhttp://noops.me/?p=461https://www.cnblogs.com/pengdonglin137/p/3578919.htmlhttps://www.cnblogs.com/pengdonglin137/p/3

2020-06-01 10:52:32 188

原创 nftables

http://www.netfilter.org/projects/nftables/

2020-05-31 12:44:05 268

原创 抓包工具

红色的比较重要。读一下这些工具的源码。iperf:

2020-05-30 23:20:46 627

原创 网络设备初始化

E:\Linux_kernel\linux-4.1.45\linux-4.1.45\include\linux\init.h/* * A "pure" initcall has no dependencies on anything else, and purely * initializes variables that couldn't be statically initialized. * * This only exists for built-in code, not for m...

2020-05-28 10:41:32 852

转载 linux的initcall机制

linux的initcall机制(针对编译进内核的驱动)initcall机制的由来我们都知道,linux对驱动程序提供静态编译进内核和动态加载两种方式,当我们试图将一个驱动程序编译进内核时,开发者通常提供一个xxx_init()函数接口以启动这个驱动程序同时提供某些服务。那么,根据常识来说,这个xxx_init()函数肯定是要在系统启动的某个时候被调用,才能启动这个驱动程序。最简单直观地做法就是:开发者试图添加一个驱动程序时,在内核启动init程序的某个地方直接添加调用自己驱动程序的xxx_

2020-05-26 14:56:09 237

原创 网络设备初始化过程分析

2020-05-26 14:52:45 448 1

原创 ubuntu编译内核

https://blog.csdn.net/weixin_38180645/article/details/82856407

2020-05-21 22:41:57 186

原创 系统调用-随便Mark一下-后面整理

系统调用号对应的系统调用在不同Linux平台上,都是相同的。这是一种规范。硬中断:CPU外围引脚接收到了电信号。 寄存器传递参数快;使用地址传参的时候,会进行地址空间的检查,看传递的这个地址是否属于这个进程的空间,就影响效率,比较慢。...

2020-05-21 22:08:32 162 2

原创 ioctl系统调用

先mark一下:https://www.cnblogs.com/lifexy/p/10289491.htmlhttps://www.cnblogs.com/tdyizhen1314/p/4896689.htmlhttps://blog.csdn.net/dayancn/article/details/52953777https://www.cnblogs.com/sky-heaven/archive/2019/11/27/11940638.htmlioctl内核实现的地方://\l

2020-05-18 22:54:18 1960

转载 安装ubuntu虚拟机

1.安装VMware Workstationhttps://blog.csdn.net/lbh_ITsy/article/details/907381412.安装ubuntu:https://www.linuxidc.com/Linux/2020-03/162547.htm3.安装vm tools用户VM workstation全屏,Linux和Windows之间复制东西。...

2020-04-26 22:57:50 296

原创 linux中>

今天在写程序的时候,碰到个bug,排查了两个小时才发现。大概是这样的:在程序中想把一条命令执行结果重定向到a.txt。例如ps > a.txt。发现a.txt内容一直为空。原来以前封装的system函数中使用了这个判断,if (NULL == strstr(cmd, "echo")){ strncat(cmd, " > /dev/null", ...

2020-04-24 20:45:51 157

原创 skb函数记录

consume_skb()/** * consume_skb - free an skbuff * @skb: buffer to free * * Drop a ref to the buffer and free it if the usage count has hit zero * Functions identically to kfree_skb, but kfree_...

2020-04-12 20:27:16 272

原创 icmp报文

傻逼了,一个ICMP报文搞得这么复杂,其实就是普通的ip报文,mac地址逐条变化,ip地址不变。中间和其他ip报文一样,可能有arp请求。https://blog.51cto.com/14437350/2476952...

2020-04-12 13:13:57 326

原创 Linux内核-arp协议

arp协议:

2020-04-11 20:56:23 2383

原创 linux系统调用

linux系统中,C库由GNU libc提供,简称glic。glibc库中除了包括C标准库外,还提供了系统调用封装。https://www.zhihu.com/question/46763480

2020-04-05 11:57:07 492

转载 中断注册

https://blog.csdn.net/baidu_31504167/article/details/101712674linux-4.1.45\include\linux\interrupt.hstatic inline int __must_checkrequest_irq(unsigned int irq, irq_handler_t handler, unsigned lon...

2020-04-04 23:40:37 655

转载 中断

cat /proc/interrupts查看中断信息:第1列表示中断号,第2-5列表示该中断在该CPU上产生的次数,第6列表示处理这个中断的中断控制器,第7列表示与这个中断相关的设备名字。...

2020-03-28 22:43:32 814

转载 /proc目录小记

https://www.jianshu.com/p/66a9891a263chttps://www.cnblogs.com/dongzhuangdian/p/11366910.htmlhttp://man7.org/linux/man-pages/man5/proc.5.htmlhttps://www.xuebuyuan.com/3228417.html可以看到/proc目录...

2019-11-24 21:49:46 245

原创 in_device和in_ifaddr数据结构

net_device、in_device、in_ifaddr数据结构关系:一、in_device数据结构:IP配置块,网络设备层与IPv4相关的配置都存放在in_device结构中,应用层可以通过ip或者ifconfig工具来修改这些配置。该结构实例的地址保存在net_device的in_ptr中,可以通过in_dev_get()访问它。访问结束后,必须使用in_dev_put()。...

2019-11-24 19:39:34 2331

原创 net-tools工具箱

虽说net-tools工具箱要被iproute2取代,但是连net-tools工具都不会,也说不过去吧。net-tools工具箱包括arp, hostname, ifconfig, netstat, rarp, route, plipconfig, slattach, mii-tool and iptunnel and ipmaddr等命令。参考:https://www.cnblogs...

2019-11-20 22:05:46 20088 1

原创 brctl命令学习

http://manpages.ubuntu.com/manpages/bionic/man8/brctl.8.htmlhttps://linux.die.net/man/8/brctlhttps://www.cnblogs.com/yinzhengjie/p/7446226.html参数说明和示例表格转载自:https://www.jianshu.com/p/665382d70a...

2019-11-20 20:56:47 2341

原创 iproute2学习

摘自:《linux大棚命令百篇-网路和系统篇》网路工具包net-tools和iproute2net-tools基于IOCTLiproute2主要基于Netlinknet-tools主要工具:iproute2主要工具:1. 查看网卡信息ip addr show2. 为网络接口添加一个IP地址3. 删除网络接口的一个IP地址4. 禁用...

2019-11-17 16:36:53 501

原创 linux nc命令学习

参考:《linux大棚命令百篇-网络和系统篇》书籍nc:netcat,网猫看一下man nc中对nc的描述:第一句话的意识是:nc工具能够胜任全天下跟TCP/UDP相关的一切操作。https://www.runoob.com/linux/linux-comm-nc.htmlnc [-hlnruz][-g<网关...>][-G<指向器数目>][-i&...

2019-11-16 23:36:17 374

原创 tcpdump学习

https://www.tcpdump.org/manpages/tcpdump.1.htmlhttps://www.cnblogs.com/chenpingzhao/p/9108570.htmlhttps://blog.csdn.net/chinaltx/article/details/87469933常用选项:-i :指定网卡,就是要抓哪个网卡的包-c:指定抓取报文数量,...

2019-11-16 19:54:23 264

转载 Linux进程间通信-共享内存

https://www.cnblogs.com/52php/p/5861372.html (一系列)https://blog.csdn.net/ljianhui/article/details/10253345https://blog.csdn.net/adorable_/article/details/80465790https://blog.csdn.net/qq_31073871...

2019-11-13 22:20:19 176

原创 iptables学习

默认是开启的,-n:不进行解析,端口不转换为对应的协议名,IP地址不转换为对应的域名。使用iptables -L查看规则后,括号里面的policy ACCEPT就表示默认规则,为ACCEPT。当把默认规则设置为DROP后,使用iptables -nvL,会显示DROP多少包, 多少字节。下...

2019-11-11 22:25:55 191

转载 linux中curl命令

转载:https://www.cnblogs.com/linjiqin/p/5484910.htmlhttps://www.cnblogs.com/sea24/articles/10108879.htmlhttps://blog.csdn.net/dengjili/article/details/90581210curl命令是个功能强大的网络工具,支持通过http、ftp等方式下载...

2019-11-11 21:44:23 918

转载 VMware虚拟网络的各自含义(VMnet0、VMnet1、VMnet8)

https://blog.csdn.net/TSZ0000/article/details/83995374https://blog.csdn.net/GoDreambjs/article/details/53199198

2019-11-11 19:59:11 1975

原创 Linux内核jhash

https://blog.csdn.net/qiujiahao123/article/details/64940620include/linux/jhash.h

2019-11-04 21:27:02 828

转载 #if0...$endif作用

https://blog.csdn.net/raining_heart/article/details/8019535https://www.cnblogs.com/nevel/p/6378035.html

2019-11-03 20:41:45 940

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除