Added a perl example to turn an IP address into a MAC address.

This commit is contained in:
Ivo Timmermans 2000-11-02 21:34:45 +00:00
parent cadf81fe67
commit 1b11bcb012

View file

@ -1,5 +1,5 @@
\input texinfo @c -*-texinfo-*- \input texinfo @c -*-texinfo-*-
@c $Id: tinc.texi,v 1.8.4.5 2000/10/14 22:22:06 zarq Exp $ @c $Id: tinc.texi,v 1.8.4.6 2000/11/02 21:34:45 zarq Exp $
@c %**start of header @c %**start of header
@setfilename tinc.info @setfilename tinc.info
@settitle tinc Manual @settitle tinc Manual
@ -17,7 +17,7 @@ Copyright @copyright{} 1998,199,2000 Ivo Timmermans
<itimmermans@@bigfoot.com>, Guus Sliepen <guus@@sliepen.warande.net> and <itimmermans@@bigfoot.com>, Guus Sliepen <guus@@sliepen.warande.net> and
Wessel Dankers <wsl@@nl.linux.org>. Wessel Dankers <wsl@@nl.linux.org>.
$Id: tinc.texi,v 1.8.4.5 2000/10/14 22:22:06 zarq Exp $ $Id: tinc.texi,v 1.8.4.6 2000/11/02 21:34:45 zarq Exp $
Permission is granted to make and distribute verbatim copies of this Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are manual provided the copyright notice and this permission notice are
@ -42,7 +42,7 @@ Copyright @copyright{} 1998,1999,2000 Ivo Timmermans
<itimmermans@@bigfoot.com>, Guus Sliepen <guus@@sliepen.warande.net> and <itimmermans@@bigfoot.com>, Guus Sliepen <guus@@sliepen.warande.net> and
Wessel Dankers <wsl@@nl.linux.org>. Wessel Dankers <wsl@@nl.linux.org>.
$Id: tinc.texi,v 1.8.4.5 2000/10/14 22:22:06 zarq Exp $ $Id: tinc.texi,v 1.8.4.6 2000/11/02 21:34:45 zarq Exp $
Permission is granted to make and distribute verbatim copies of this Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are manual provided the copyright notice and this permission notice are
@ -554,6 +554,14 @@ $ printf 'fe:fd:%02x:%02x:%02x:%02x' 10 1 54 1
fe:fd:0a:01:36:01 fe:fd:0a:01:36:01
@end example @end example
or with perl:
@example
$ perl -e 'print "fe:fd:", join(":", map @{sprintf "%02x", $_@} split(/\./, $ARGV[0])), "\n";' 10.1.54.1
fe:fd:0a:01:36:01
@end example
@cindex ifconfig @cindex ifconfig
To activate the device, you have to assign an IP address to it. To set To activate the device, you have to assign an IP address to it. To set
an IP address @emph{IP} with network mask @emph{mask}, do the following: an IP address @emph{IP} with network mask @emph{mask}, do the following: