Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mac_pton

Proto:bool mac_pton(const char *s, u8 *mac)

Type:bool

Parameter:

TypeParameterName
const char *s
u8 *mac
12  If strlen(s) < 3 * Octets in one ethernet addr - 1 Then Return false
16  When i < Octets in one ethernet addr cycle
17  If Not isxdigit(s[i * 3]) || Not isxdigit(s[i * 3 + 1]) Then Return false
19  If i != Octets in one ethernet addr - 1 && s[i * 3 + 2] != ':' Then Return false
22  When i < Octets in one ethernet addr cycle
23  mac[i] = hex_to_bin - convert a hex digit to its real value*@ch: ascii character represents hex digit* hex_to_bin() converts one hex digit to its actual value or -1 in case of bad* input. << 4 | hex_to_bin - convert a hex digit to its real value*@ch: ascii character represents hex digit* hex_to_bin() converts one hex digit to its actual value or -1 in case of bad* input.
25  Return true