Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_bpf.c Create Date:2022-07-28 06:27:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:populate_skb

Proto:static struct sk_buff *populate_skb(char *buf, int size)

Type:struct sk_buff

Parameter:

TypeParameterName
char *buf
intsize
6472  If size >= MAX_DATA Then Return NULL
6475  skb = allocate a network buffer
6476  If Not skb Then Return NULL
6479  __skb_put_data(skb, buf, size)
6482  skb_reset_mac_header(skb)
6483  protocol = htons(Internet Protocol packet )
6484  pkt_type = Few constants used to init test 'skb'
6485  mark = SKB_MARK
6486  hash = SKB_HASH
6487  Following fields are _not_ copied in __copy_skb_header() * Note that queue_mapping is here mostly to fill a hole. = SKB_QUEUE_MAP
6488  vlan_tci = SKB_VLAN_TCI
6489  vlan_present = SKB_VLAN_PRESENT
6490  vlan_proto = htons(Internet Protocol packet )
6491  dev_net_set( & dev, & Init's network namespace )
6492  dev = dev
6493  ifindex = SKB_DEV_IFINDEX
6494  type = SKB_DEV_TYPE
6495  skb_set_network_header(skb, min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(size, Total octets in header. ))
6497  Return skb
Caller
NameDescribe
generate_test_data