Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ip6_addr_string_sa

Proto:static __attribute__((__noinline__)) char *ip6_addr_string_sa(char *buf, char *end, const struct sockaddr_in6 *sa, struct printf_spec spec, const char *fmt)

Type:char

Parameter:

TypeParameterName
char *buf
char *end
const struct sockaddr_in6 *sa
struct printf_specspec
const char *fmt
1456  bool have_p = false, have_s = false, have_f = false, have_c = false
1460  p = ip6_addr , pend = ip6_addr + size of ip6_addr
1461  const u8 * addr = (const u8 * ) & IPv6 address
1462  char fmt6[2] = {fmt[0], '6'}
1463  off = 0
1465  fmt++
1466  When isalpha( * ++fmt) cycle
1468  Case fmt == 'p'
1469  have_p = true
1470  Break
1471  Case fmt == 'f'
1472  have_f = true
1473  Break
1474  Case fmt == 's'
1475  have_s = true
1476  Break
1477  Case fmt == 'c'
1478  have_c = true
1479  Break
1483  If have_p || have_s || have_f Then
1484  p = '['
1485  off = 1
1488  If fmt6[0] == 'I' && have_c Then p = ip6_compressed_string(ip6_addr + off, addr)
1490  Else p = ip6_string(ip6_addr + off, addr, fmt6)
1493  If have_p || have_s || have_f Then p++ = ']'
1496  If have_p Then
1497  p++ = ':'
1498  p = number(p, pend, ntohs( Transport layer port # ), spec)
1500  If have_f Then
1501  p++ = '/'
1502  p = number(p, pend, ntohl( IPv6 flow information & IPV6_FLOWINFO_MASK), spec)
1505  If have_s Then
1506  p++ = '%'
1507  p = number(p, pend, scope id (new in RFC2553) , spec)
1509  p = '\0'
1511  Return Handle string from a well known address.
Caller
NameDescribe
ip_addr_string