Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\vsprintf.c Create Date:2022-07-28 06:12:12
Last Modify:2022-05-21 09:47:42 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ip6_compressed_string

Proto:static __attribute__((__noinline__)) char *ip6_compressed_string(char *p, const char *addr)

Type:char

Parameter:

TypeParameterName
char *p
const char *addr
1333  longest = 1
1334  colonpos = -1
1337  bool needcolon = false
1341  No 3D Now!( & in6, addr, sizeof(structin6_addr))
1343  useIPv4 = Note that we must __force cast these to unsigned long to make sparse happy,* since all of the endian-annotated types are fixed size regardless of arch. || ipv6_addr_is_isatap( & in6)
1345  memset(zerolength, 0, size of zerolength )
1347  If useIPv4 Then range = 6
1349  Else range = 8
1353  When i < range cycle
1354  When j < range cycle
1355  If s6_addr16[j] != 0 Then Break
1357  zerolength[i]++
1360  When i < range cycle
1361  If zerolength[i] > longest Then
1362  longest = zerolength[i]
1363  colonpos = i
1366  If longest == 1 Then colonpos = -1
1370  When i < range cycle
1371  If i == colonpos Then
1372  If needcolon || i == 0 Then p++ = ':'
1374  p++ = ':'
1375  needcolon = false
1376  i += longest - 1
1377  Continue
1379  If needcolon Then
1380  p++ = ':'
1381  needcolon = false
1384  word = ntohs(s6_addr16[i])
1385  hi = word >> 8
1386  lo = word & 0xff
1387  If hi Then
1388  If hi > 0x0f Then p = hex_byte_pack(p, hi)
1390  Else p++ = hex_asc_lo(hi)
1392  p = hex_byte_pack(p, lo)
1394  Else if lo > 0x0f Then p = hex_byte_pack(p, lo)
1396  Else p++ = hex_asc_lo(lo)
1398  needcolon = true
1401  If useIPv4 Then
1402  If needcolon Then p++ = ':'
1404  p = ip4_string(p, & s6_addr[12], "I4")
1406  p = '\0'
1408  Return p
Caller
NameDescribe
ip6_addr_string
ip6_addr_string_sa