]> git.ipfire.org Git - thirdparty/glibc.git/blame - inet/tst-ether_aton.c
Update.
[thirdparty/glibc.git] / inet / tst-ether_aton.c
CommitLineData
6739da7f
UD
1#include <netinet/ether.h>
2
3int
4main (int argc, char *argv[])
5{
6 struct ether_addr *val;
7 int result;
8
9 val = ether_aton ("12:34:56:78:9a:bc");
10
11 printf ("ether_aton (\"12:34:56:78:9a:bc\") = %hhx:%hhx:%hhx:%hhx:%hhx:%hhx\n",
12 val->ether_addr_octet[0],
13 val->ether_addr_octet[1],
14 val->ether_addr_octet[2],
15 val->ether_addr_octet[3],
16 val->ether_addr_octet[4],
17 val->ether_addr_octet[5]);
18
19
20 result = (val->ether_addr_octet[0] != 0x12
21 || val->ether_addr_octet[1] != 0x34
22 || val->ether_addr_octet[2] != 0x56
23 || val->ether_addr_octet[3] != 0x78
24 || val->ether_addr_octet[4] != 0x9a
25 || val->ether_addr_octet[5] != 0xbc);
26
27 return result;
28}