Giter Site home page Giter Site logo

nl80211's Introduction

for kernel 4.19

Goal:

analyse when kernel receive generical netlink message, how kernel processing it.

file description:

  1. nl80211.c: interface for wireless generic netlink programming, in /net/wireless dir, is cfg80211 module
  2. nl80211.h: the data structure for nl80211.c, in /net/wireless dir, is cfg80211 module
  3. genetlink.h: genl data structure, in your system /usr/src/linux-head-xxx/include/net dir
  4. genetlink.c: genl operation, the interface for nl80211.c, in linux-source/net/netlink dir, is netlink_diag module
  5. netlink.h: netlink operation, in your system /usr/src/linux-head-xxx/include/net dir
  6. nlattr.c: netlink attribute operation, in linux-source/lib dir

Ongoing:

  1. kernel received message put into genl_info, how kernel put it?
  2. use nl80211.c's function process it, for example, nl80211_get_wiphy
  3. and then put the processed message into struct sk_buf

编译cfg80211模块

进入内核的源码目录net/wireless

1.修改trace.h文件中的最后的路径为当前目录的路径

2.把Makefile删掉

添加这个Kbuild文件,然后执行下面的命令

make -C /lib/modules/$(uname -r)/build/ M=$PWD

TO DO

how the kernel get struct genl_info

Info:

Data structure

File Data structure/Function Description Link
include/net/mac802.11.h struct ieee80211_tx_info
include/linux/skbuff.h skb_put_data copy data to skb
include/linux/netdevice.h struct net_device_ops This structure defines the management hooks for network devices link
include/linux/skbuff.h struct sk_buff a metadata structure and does not hold any packet data(?) link
uapi/linux/if_ether.h skb->protocol struct sk_buff protocol filed(only ethernet frame type?) link
include/uapi/linux/nl80211.h enum nl80211_iftype (virtual) interface types link
/net/core/dev.c netif_rx send buffer to network stack link

Ubuntu linux header

/usr/src

Download your system kernel

1. get your kernel release

uname -r

2. find the kernel source

3. download specific directory

reference

https://elixir.bootlin.com/linux/v4.13/ident/skb_put_data

nl80211's People

Contributors

chen172 avatar

Stargazers

小王子与木头人 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.