Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\lsm_audit.c Create Date:2022-07-28 19:30:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pv6_skb_to_auditdata : fill auditdata from skb*@skb : the skb*@ad : the audit data to fill*@proto : the layer 4 protocol* return 0 on success

Proto:int ipv6_skb_to_auditdata(struct sk_buff *skb, struct common_audit_data *ad, u8 *proto)

Type:int

Parameter:

TypeParameterName
struct sk_buff *skb
struct common_audit_data *ad
u8 *proto
111  ret = 0
116  ip6 = ipv6_hdr(skb)
117  If (ip6 == NULL) Then Return -EINVAL
119  saddr = saddr
120  daddr = daddr
121  ret = 0
124  offset = skb_network_offset(skb)
125  offset += size of ip6
126  nexthdr = nexthdr
127  offset = ipv6_skip_exthdr(skb, offset, & nexthdr, & frag_off)
128  If offset < 0 Then Return 0
130  If proto Then proto = nexthdr
133  Case nexthdr == IPPROTO_TCP
136  th = skb_header_pointer(skb, offset, size of _tcph , & _tcph)
137  If (th == NULL) Then Break
140  sport = source
141  dport = dest
142  Break
144  Case nexthdr == IPPROTO_UDP
147  uh = skb_header_pointer(skb, offset, size of _udph , & _udph)
148  If (uh == NULL) Then Break
151  sport = source
152  dport = dest
153  Break
155  Case nexthdr == IPPROTO_DCCP
158  dh = skb_header_pointer(skb, offset, size of _dccph , & _dccph)
159  If (dh == NULL) Then Break
162  sport = dccph_sport
163  dport = dccph_dport
164  Break
166  Case nexthdr == IPPROTO_SCTP
169  sh = skb_header_pointer(skb, offset, size of _sctph , & _sctph)
170  If (sh == NULL) Then Break
172  sport = source
173  dport = dest
174  Break
176  Default
177  ret = -EINVAL
179  Return ret