xref: /dflybsd-src/share/man/man9/kether_ntoa.9 (revision 0f59fd793e651a8db069804c4db8d76a061576e2)
1a8835243SAntonio Huete Jimenez.\"
2a8835243SAntonio Huete Jimenez.\" Copyright (c) 2013 The DragonFly Project.  All rights reserved.
3a8835243SAntonio Huete Jimenez.\"
4a8835243SAntonio Huete Jimenez.\" Redistribution and use in source and binary forms, with or without
5a8835243SAntonio Huete Jimenez.\" modification, are permitted provided that the following conditions
6a8835243SAntonio Huete Jimenez.\" are met:
7a8835243SAntonio Huete Jimenez.\"
8a8835243SAntonio Huete Jimenez.\" 1. Redistributions of source code must retain the above copyright
9a8835243SAntonio Huete Jimenez.\"    notice, this list of conditions and the following disclaimer.
10a8835243SAntonio Huete Jimenez.\" 2. Redistributions in binary form must reproduce the above copyright
11a8835243SAntonio Huete Jimenez.\"    notice, this list of conditions and the following disclaimer in
12a8835243SAntonio Huete Jimenez.\"    the documentation and/or other materials provided with the
13a8835243SAntonio Huete Jimenez.\"    distribution.
14a8835243SAntonio Huete Jimenez.\" 3. Neither the name of The DragonFly Project nor the names of its
15a8835243SAntonio Huete Jimenez.\"    contributors may be used to endorse or promote products derived
16a8835243SAntonio Huete Jimenez.\"    from this software without specific, prior written permission.
17a8835243SAntonio Huete Jimenez.\"
18a8835243SAntonio Huete Jimenez.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19a8835243SAntonio Huete Jimenez.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20a8835243SAntonio Huete Jimenez.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21a8835243SAntonio Huete Jimenez.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
22a8835243SAntonio Huete Jimenez.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23a8835243SAntonio Huete Jimenez.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
24a8835243SAntonio Huete Jimenez.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25a8835243SAntonio Huete Jimenez.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26a8835243SAntonio Huete Jimenez.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27a8835243SAntonio Huete Jimenez.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
28a8835243SAntonio Huete Jimenez.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29a8835243SAntonio Huete Jimenez.\" SUCH DAMAGE.
30a8835243SAntonio Huete Jimenez.\"
31c184c4f4SAntonio Huete Jimenez.Dd February 7, 2012
32a8835243SAntonio Huete Jimenez.Dt KETHER_NTOA 9
33a8835243SAntonio Huete Jimenez.Os
34a8835243SAntonio Huete Jimenez.Sh NAME
35*0f59fd79SSascha Wildner.Nm kether_ntoa ,
36*0f59fd79SSascha Wildner.Nm kether_aton
37a8835243SAntonio Huete Jimenez.Nd ethernet address conversion routines
38a8835243SAntonio Huete Jimenez.Sh SYNOPSIS
39a8835243SAntonio Huete Jimenez.In net/if_var.h
40a8835243SAntonio Huete Jimenez.Ft char *
41d22af07cSSascha Wildner.Fn kether_ntoa "const u_char *addr" "char *buf"
42a8835243SAntonio Huete Jimenez.Ft u_char *
43d22af07cSSascha Wildner.Fn kether_aton "const char *macstr" "u_char *addr"
44a8835243SAntonio Huete Jimenez.Sh DESCRIPTION
45a8835243SAntonio Huete JimenezThe
46a8835243SAntonio Huete Jimenez.Fn kether_ntoa
47a8835243SAntonio Huete Jimenezfunction converts the ethernet address specified in
48a8835243SAntonio Huete Jimenez.Fa addr
496a8649c9SSascha Wildnerto its corresponding hexadecimal ASCII representation.
50a8835243SAntonio Huete JimenezLikewise, the
51a8835243SAntonio Huete Jimenez.Fn kether_aton
52a8835243SAntonio Huete Jimenezfunction converts an ASCII
53a8835243SAntonio Huete Jimenezstring specified in
54a8835243SAntonio Huete Jimenez.Fa macstr
55a8835243SAntonio Huete Jimenezto an ethernet address.
56a8835243SAntonio Huete Jimenez.Pp
576a8649c9SSascha Wildner.Fn kether_ntoa
586a8649c9SSascha Wildnerserves a similar purpose as the former, non-standard
596a8649c9SSascha Wildner.Cm D
606a8649c9SSascha Wildnerconversion of
616a8649c9SSascha Wildner.Xr kprintf 9
626a8649c9SSascha Wildner(as in,
636a8649c9SSascha Wildner.Dq %6D )
646a8649c9SSascha Wildnerwhich some
656a8649c9SSascha Wildner.Bx Ns s
666a8649c9SSascha Wildnerstill have.
676a8649c9SSascha Wildner.Pp
68a8835243SAntonio Huete JimenezNotational conventions for hexadecimal ASCII
69a8835243SAntonio Huete Jimenezrepresentation of a MAC
70a8835243SAntonio Huete Jimenezaddress are specified in IEEE 802.
71a8835243SAntonio Huete Jimenez.Sh RETURN VALUES
72a8835243SAntonio Huete JimenezThe
73a8835243SAntonio Huete Jimenez.Fn kether_ntoa
74a8835243SAntonio Huete Jimenezfunction returns a pointer to the string containing the hexadecimal ASCII
75a8835243SAntonio Huete Jimenezrepresentation of the ethernet address passed in
76a8835243SAntonio Huete Jimenez.Fa addr ,
77a8835243SAntonio Huete Jimenezor NULL in the case of failure.
78a8835243SAntonio Huete Jimenez.Pp
79a8835243SAntonio Huete JimenezThe
80a8835243SAntonio Huete Jimenez.Fn kether_aton
81a8835243SAntonio Huete Jimenezfunction returns a pointer to a block of bytes containing the conversion
82a8835243SAntonio Huete Jimenezof the specified ASCII
83a8835243SAntonio Huete Jimenezstring in
84a8835243SAntonio Huete Jimenez.Fa macstr ,
85a8835243SAntonio Huete Jimenezor NULL in the case of failure.
86a8835243SAntonio Huete Jimenez.Sh SEE ALSO
87a8835243SAntonio Huete Jimenez.Xr ascii 7 ,
886a8649c9SSascha Wildner.Xr hexdump 9 ,
896a8649c9SSascha Wildner.Xr hexncpy 9
90a8835243SAntonio Huete Jimenez.Sh HISTORY
91a8835243SAntonio Huete JimenezThe
92a8835243SAntonio Huete Jimenez.Fn kether_ntoa
93a8835243SAntonio Huete Jimenezand
94a8835243SAntonio Huete Jimenez.Fn kether_aton
95a8835243SAntonio Huete Jimenezfunctions first appeared in
966a8649c9SSascha Wildner.Dx 3.3 .
97