[oe-commits] org.oe.dev packages: Add net-tools to OpenEmbedded
freyther commit
openembedded-commits at lists.openembedded.org
Thu Oct 26 12:43:03 UTC 2006
packages: Add net-tools to OpenEmbedded
Author: freyther at openembedded.org
Branch: org.openembedded.dev
Revision: a7575627b34ce30f870b874d22801147e89cc862
ViewMTN: http://monotone.openembedded.org/revision.psp?id=a7575627b34ce30f870b874d22801147e89cc862
Files:
1
packages/net-tools
packages/net-tools/files
packages/net-tools/files/README
packages/net-tools/files/ether-wake.8
packages/net-tools/files/ether-wake.c
packages/net-tools/files/mii-diag.8
packages/net-tools/files/mii-diag.c
packages/net-tools/files/net-tools-1.57-bug22040.patch
packages/net-tools/files/net-tools-1.60-arp_overflow.patch
packages/net-tools/files/net-tools-1.60-bcast.patch
packages/net-tools/files/net-tools-1.60-bitkeeper.patch
packages/net-tools/files/net-tools-1.60-config.h
packages/net-tools/files/net-tools-1.60-config.make
packages/net-tools/files/net-tools-1.60-cycle.patch
packages/net-tools/files/net-tools-1.60-de.patch
packages/net-tools/files/net-tools-1.60-duplicate-tcp.patch
packages/net-tools/files/net-tools-1.60-gcc33.patch
packages/net-tools/files/net-tools-1.60-gcc34.patch
packages/net-tools/files/net-tools-1.60-hostname_man.patch
packages/net-tools/files/net-tools-1.60-ifaceopt.patch
packages/net-tools/files/net-tools-1.60-ifconfig.patch
packages/net-tools/files/net-tools-1.60-ifconfig_ib.patch
packages/net-tools/files/net-tools-1.60-inet6-lookup.patch
packages/net-tools/files/net-tools-1.60-interface.patch
packages/net-tools/files/net-tools-1.60-interface_stack.patch
packages/net-tools/files/net-tools-1.60-ipx.patch
packages/net-tools/files/net-tools-1.60-isofix.patch
packages/net-tools/files/net-tools-1.60-man.patch
packages/net-tools/files/net-tools-1.60-manydevs.patch
packages/net-tools/files/net-tools-1.60-mii-tool-obsolete.patch
packages/net-tools/files/net-tools-1.60-miiioctl.patch
packages/net-tools/files/net-tools-1.60-nameif.patch
packages/net-tools/files/net-tools-1.60-netmask.patch
packages/net-tools/files/net-tools-1.60-netstat_stop_trim.patch
packages/net-tools/files/net-tools-1.60-netstat_ulong.patch
packages/net-tools/files/net-tools-1.60-note.patch
packages/net-tools/files/net-tools-1.60-num-ports.patch
packages/net-tools/files/net-tools-1.60-overflow.patch
packages/net-tools/files/net-tools-1.60-parse.patch
packages/net-tools/files/net-tools-1.60-pie.patch
packages/net-tools/files/net-tools-1.60-return.patch
packages/net-tools/files/net-tools-1.60-selinux.patch
packages/net-tools/files/net-tools-1.60-siunits.patch
packages/net-tools/files/net-tools-1.60-statalias.patch
packages/net-tools/files/net-tools-1.60-statistics.patch
packages/net-tools/files/net-tools-1.60-stdo.patch
packages/net-tools/files/net-tools-1.60-trailingblank.patch
packages/net-tools/files/net-tools-1.60-trim_iface.patch
packages/net-tools/files/net-tools-1.60-trunc.patch
packages/net-tools/files/net-tools-1.60-ulong.patch
packages/net-tools/files/net-tools-1.60-virtualname.patch
packages/net-tools/net-tools_1.60.bb
Diffs:
#
# mt diff -r194df4f87b769d9e43dbfbee4de23f91c5c37739 -ra7575627b34ce30f870b874d22801147e89cc862
#
#
#
# add_dir "packages/net-tools"
#
# add_dir "packages/net-tools/files"
#
# add_file "packages/net-tools/files/README"
# content [52adbb1508a4ef54be1570dd2820c6caf2d23a9c]
#
# add_file "packages/net-tools/files/ether-wake.8"
# content [f4ea98784167564a8b836c5eb34498c8232176fa]
#
# add_file "packages/net-tools/files/ether-wake.c"
# content [85e87893722e6be3cc3b4980fd219d5e2621e895]
#
# add_file "packages/net-tools/files/mii-diag.8"
# content [aad57581378fa51a6dfc0b78bdd3478daacb38bd]
#
# add_file "packages/net-tools/files/mii-diag.c"
# content [b1299d8fafd91af0ae6b9357b847466257a8f2a4]
#
# add_file "packages/net-tools/files/net-tools-1.57-bug22040.patch"
# content [4d9c866e8131368027c205d1a4fdceaff01a46ce]
#
# add_file "packages/net-tools/files/net-tools-1.60-arp_overflow.patch"
# content [7993cbbb35b1031d9bd18efb6310c392250cffdf]
#
# add_file "packages/net-tools/files/net-tools-1.60-bcast.patch"
# content [7eb78c5b55b3e3b9764a48e3f956819d3a1ef05d]
#
# add_file "packages/net-tools/files/net-tools-1.60-bitkeeper.patch"
# content [0aae74ebbef27e7dfd8fd2931aa5e9bca1f529cb]
#
# add_file "packages/net-tools/files/net-tools-1.60-config.h"
# content [6969085d6cd387ca74f754175d422e9aafc87e64]
#
# add_file "packages/net-tools/files/net-tools-1.60-config.make"
# content [e033e42a86e554b03503f33253f780903102b225]
#
# add_file "packages/net-tools/files/net-tools-1.60-cycle.patch"
# content [ac30f3ce615965f5c765ac02c2727a605dc4eb3d]
#
# add_file "packages/net-tools/files/net-tools-1.60-de.patch"
# content [32c9c820190ad1e6d8c8fc4b299b3c4f2fb850a7]
#
# add_file "packages/net-tools/files/net-tools-1.60-duplicate-tcp.patch"
# content [895566ab620bbf0a3e5045a2210cbfa8b0e5378a]
#
# add_file "packages/net-tools/files/net-tools-1.60-gcc33.patch"
# content [124f6c4d6931df71ab9d3e25056a427ca5fb3733]
#
# add_file "packages/net-tools/files/net-tools-1.60-gcc34.patch"
# content [f52cdb6f713bfc322d973a831a6faa40199f25f2]
#
# add_file "packages/net-tools/files/net-tools-1.60-hostname_man.patch"
# content [f2a7a4f3815e1331bf70390e27150a2288e85221]
#
# add_file "packages/net-tools/files/net-tools-1.60-ifaceopt.patch"
# content [83c8be99faf70e0be05a14a42317ea8de2bd5973]
#
# add_file "packages/net-tools/files/net-tools-1.60-ifconfig.patch"
# content [1d32a029507745a4dce501f498ed5c2392c575cb]
#
# add_file "packages/net-tools/files/net-tools-1.60-ifconfig_ib.patch"
# content [ca7b217e1dfa42c45fc30b315c7e88f645a6b24f]
#
# add_file "packages/net-tools/files/net-tools-1.60-inet6-lookup.patch"
# content [ad366f273138a07cc337106fe3a646c06cb93166]
#
# add_file "packages/net-tools/files/net-tools-1.60-interface.patch"
# content [8f8593843921502a47dc748f7466dc2be4c33bdb]
#
# add_file "packages/net-tools/files/net-tools-1.60-interface_stack.patch"
# content [e73e0ba891bf5f01069e553c392318d66a81227c]
#
# add_file "packages/net-tools/files/net-tools-1.60-ipx.patch"
# content [c0bc32f6814bc31fb4176810b60920021de7727c]
#
# add_file "packages/net-tools/files/net-tools-1.60-isofix.patch"
# content [f6898ff5c7bb5eafa0cc2093daf96f274c4a2663]
#
# add_file "packages/net-tools/files/net-tools-1.60-man.patch"
# content [72aa41c33ee15475bc3389f5384f96cc0be704bf]
#
# add_file "packages/net-tools/files/net-tools-1.60-manydevs.patch"
# content [4920f5d4b8e6eb0a9b839b42d9e89acd51f21397]
#
# add_file "packages/net-tools/files/net-tools-1.60-mii-tool-obsolete.patch"
# content [fe9c2e8248920f0c8c6fb0214f19eef1f8e6e77a]
#
# add_file "packages/net-tools/files/net-tools-1.60-miiioctl.patch"
# content [103dd529bf579605e198615ba06c7bdc947fae9c]
#
# add_file "packages/net-tools/files/net-tools-1.60-nameif.patch"
# content [fb12d7b0a05f1a3ff4cb6455c4de7b53c9269d99]
#
# add_file "packages/net-tools/files/net-tools-1.60-netmask.patch"
# content [fb8320732578379b64b20438792a4424005c582b]
#
# add_file "packages/net-tools/files/net-tools-1.60-netstat_stop_trim.patch"
# content [6ce633b8dcd4edf067d4b6c25d0dd1134b40e635]
#
# add_file "packages/net-tools/files/net-tools-1.60-netstat_ulong.patch"
# content [27fe5e3fbee4f93f1c3ff80dc80c1371aeda5240]
#
# add_file "packages/net-tools/files/net-tools-1.60-note.patch"
# content [0762a03af70f77951d991a36f27f8c6017acb600]
#
# add_file "packages/net-tools/files/net-tools-1.60-num-ports.patch"
# content [3f74a4decc7c7fa17372004ed27ec2212342f1dd]
#
# add_file "packages/net-tools/files/net-tools-1.60-overflow.patch"
# content [b8a32360706f29d72ec1b6d40e6a331ef4c06cd6]
#
# add_file "packages/net-tools/files/net-tools-1.60-parse.patch"
# content [5bd54fd10a66429a357cb5ceb99f25e551444bdc]
#
# add_file "packages/net-tools/files/net-tools-1.60-pie.patch"
# content [7095dceb8f780a64c3416131c6696c29fd87655c]
#
# add_file "packages/net-tools/files/net-tools-1.60-return.patch"
# content [31de4670717b012844960352fcd2c63dfe1f8d53]
#
# add_file "packages/net-tools/files/net-tools-1.60-selinux.patch"
# content [82741efeb31d332e02ac26db9feec136a90fa1f1]
#
# add_file "packages/net-tools/files/net-tools-1.60-siunits.patch"
# content [aac7e67adbdd60b8b2fc7e622d9c88c398f60741]
#
# add_file "packages/net-tools/files/net-tools-1.60-statalias.patch"
# content [cacb4ec12db12ebc98d6f6f700c26ffdaaa0557f]
#
# add_file "packages/net-tools/files/net-tools-1.60-statistics.patch"
# content [4032e292d7b0c708b6cbd73e1a49f41ab16f272e]
#
# add_file "packages/net-tools/files/net-tools-1.60-stdo.patch"
# content [0c274e7caea455abdde09e5f4643b509cbd859cf]
#
# add_file "packages/net-tools/files/net-tools-1.60-trailingblank.patch"
# content [ce52d3a7b96715ee55ff64e4184538dca8188671]
#
# add_file "packages/net-tools/files/net-tools-1.60-trim_iface.patch"
# content [8a7941c43ddcb0349ddf742ce60b0f9ab20c1afc]
#
# add_file "packages/net-tools/files/net-tools-1.60-trunc.patch"
# content [3bc4185d9de7e03edcdf41cc1c41ef5f03636be1]
#
# add_file "packages/net-tools/files/net-tools-1.60-ulong.patch"
# content [917d91c0190a12ee34b730157dedcea789a20f5c]
#
# add_file "packages/net-tools/files/net-tools-1.60-virtualname.patch"
# content [4640c5573f00e4cf2bb901c4051f08afc2e130f4]
#
# add_file "packages/net-tools/net-tools_1.60.bb"
# content [1d5173a892e5207ec56c88bd3a49068ec575b304]
#
============================================================
--- packages/net-tools/files/README 52adbb1508a4ef54be1570dd2820c6caf2d23a9c
+++ packages/net-tools/files/README 52adbb1508a4ef54be1570dd2820c6caf2d23a9c
@@ -0,0 +1 @@
+Patches were downloaded from http://ftp.uni-koeln.de/mirrors/fedora/linux/core/5/source/SRPMS/net-tools-1.60-62.1.src.rpm
============================================================
--- packages/net-tools/files/ether-wake.8 f4ea98784167564a8b836c5eb34498c8232176fa
+++ packages/net-tools/files/ether-wake.8 f4ea98784167564a8b836c5eb34498c8232176fa
@@ -0,0 +1,81 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ETHER-WAKE 8 "March 31, 2003" "Scyld"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+ether-wake \- A tool to send a Wake-On-LAN "Magic Packet"
+.SH SYNOPSIS
+.B ether-wake
+.RI [ options ] " Host-ID"
+.SH DESCRIPTION
+This manual page documents the usage of the
+.B ether-wake
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBether-wake\fP is a program that generates and transmits a Wake-On-LAN
+(WOL) "Magic Packet", used for restarting machines that have been
+soft-powered-down (ACPI D3-warm state). It generates the standard
+AMD Magic Packet format, optionally with a password included. The
+single required parameter is a station (MAC) address or a host ID that can
+be translated to a MAC address by an
+.BR ethers (5)
+database specified in
+.BR nsswitch.conf (5)
+.
+.SH OPTIONS
+\fBether-wake\fP needs a single dash (´-´) in front of options.
+A summary of options is included below.
+.TP
+.B \-b
+Send the wake-up packet to the broadcast address.
+.TP
+.B \-D
+Increase the Debug Level.
+.TP
+.B \-i ifname
+Use interface ifname instead of the default "eth0".
+.TP
+.B \-p passwd
+Append a four or six byte password to the packet. Only a few adapters
+need or support this. A six byte password may be specified in Ethernet hex
+format (00:22:44:66:88:aa) or four byte dotted decimal (192.168.1.1) format.
+A four byte password must use the dotted decimal format.
+
+.TP
+.B \-V
+Show the program version information.
+
+.SH EXIT STATUS
+This program returns 0 on success.
+A permission failures (e.g. run as a non-root user) results in an exit
+status of 2. Unrecognized or invalid parameters result in an exit
+status of 3. Failure to retrieve network interface information or send
+a packet will result in an exit status of 1.
+
+.SH SEE ALSO
+.BR arp (8).
+.br
+.SH SECURITY
+On some non-Linux systems dropping root capability allows the process to be
+dumped, traced or debugged.
+If someone traces this program, they get control of a raw socket.
+Linux handles this safely, but beware when porting this program.
+.SH AUTHOR
+The etherwake program was written by Donald Becker at Scyld Computing
+Corporation for use with the Scyld(\*(Tm) Beowulf System.
============================================================
--- packages/net-tools/files/ether-wake.c 85e87893722e6be3cc3b4980fd219d5e2621e895
+++ packages/net-tools/files/ether-wake.c 85e87893722e6be3cc3b4980fd219d5e2621e895
@@ -0,0 +1,392 @@
+/* ether-wake.c: Send a magic packet to wake up sleeping machines. */
+
+static char version_msg[] =
+"ether-wake.c: v1.09 11/12/2003 Donald Becker, http://www.scyld.com/";
+static char brief_usage_msg[] =
+"usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n"
+" Use '-u' to see the complete set of options.\n";
+static char usage_msg[] =
+"usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n"
+"\n"
+" This program generates and transmits a Wake-On-LAN (WOL)\n"
+" \"Magic Packet\", used for restarting machines that have been\n"
+" soft-powered-down (ACPI D3-warm state).\n"
+" It currently generates the standard AMD Magic Packet format, with\n"
+" an optional password appended.\n"
+"\n"
+" The single required parameter is the Ethernet MAC (station) address\n"
+" of the machine to wake or a host ID with known NSS 'ethers' entry.\n"
+" The MAC address may be found with the 'arp' program while the target\n"
+" machine is awake.\n"
+"\n"
+" Options:\n"
+" -b Send wake-up packet to the broadcast address.\n"
+" -D Increase the debug level.\n"
+" -i ifname Use interface IFNAME instead of the default 'eth0'.\n"
+" -p <pw> Append the four or six byte password PW to the packet.\n"
+" A password is only required for a few adapter types.\n"
+" The password may be specified in ethernet hex format\n"
+" or dotted decimal (Internet address)\n"
+" -p 00:22:44:66:88:aa\n"
+" -p 192.168.1.1\n";
+
+/*
+ This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet",
+ used for restarting machines that have been soft-powered-down
+ (ACPI D3-warm state). It currently generates the standard AMD Magic Packet
+ format, with an optional password appended.
+
+ This software may be used and distributed according to the terms
+ of the GNU Public License, incorporated herein by reference.
+ Contact the author for use under other terms.
+
+ This source file was originally part of the network tricks package, and
+ is now distributed to support the Scyld Beowulf system.
+ Copyright 1999-2003 Donald Becker and Scyld Computing Corporation.
+
+ The author may be reached as becker at scyld, or C/O
+ Scyld Computing Corporation
+ 914 Bay Ridge Road, Suite 220
+ Annapolis MD 21403
+
+ Notes:
+ On some systems dropping root capability allows the process to be
+ dumped, traced or debugged.
+ If someone traces this program, they get control of a raw socket.
+ Linux handles this safely, but beware when porting this program.
+
+ An alternative to needing 'root' is using a UDP broadcast socket, however
+ doing so only works with adapters configured for unicast+broadcast Rx
+ filter. That configuration consumes more power.
+*/
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+
+#if 0 /* Only exists on some versions. */
+#include <ioctls.h>
+#endif
+
+#include <sys/socket.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <linux/if.h>
+
+#include <features.h>
+#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+#include <netpacket/packet.h>
+#include <net/ethernet.h>
+#else
+#include <asm/types.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h>
+#endif
+#include <netdb.h>
+#include <netinet/ether.h>
+
+/* Grrr, no consistency between include versions.
+ Enable this if setsockopt() isn't declared with your library. */
+#if 0
+extern int setsockopt __P ((int __fd, int __level, int __optname,
+ __ptr_t __optval, int __optlen));
+#else /* New, correct head files. */
+#include <sys/socket.h>
+#endif
+
+u_char outpack[1000];
+int outpack_sz = 0;
+int debug = 0;
+u_char wol_passwd[6];
+int wol_passwd_sz = 0;
+
+static int opt_no_src_addr = 0, opt_broadcast = 0;
+
+static int get_dest_addr(const char *arg, struct ether_addr *eaddr);
+static int get_fill(unsigned char *pkt, struct ether_addr *eaddr);
+static int get_wol_pw(const char *optarg);
+
+int main(int argc, char *argv[])
+{
+ char *ifname = "eth0";
+ int one = 1; /* True, for socket options. */
+ int s; /* Raw socket */
+ int errflag = 0, verbose = 0, do_version = 0;
+ int perm_failure = 0;
+ int i, c, pktsize;
+#if defined(PF_PACKET)
+ struct sockaddr_ll whereto;
+#else
+ struct sockaddr whereto; /* who to wake up */
+#endif
+ struct ether_addr eaddr;
+
+ while ((c = getopt(argc, argv, "bDi:p:uvV")) != -1)
+ switch (c) {
+ case 'b': opt_broadcast++; break;
+ case 'D': debug++; break;
+ case 'i': ifname = optarg; break;
+ case 'p': get_wol_pw(optarg); break;
+ case 'u': printf(usage_msg); return 0;
+ case 'v': verbose++; break;
+ case 'V': do_version++; break;
+ case '?':
+ errflag++;
+ }
+ if (verbose || do_version)
+ printf("%s\n", version_msg);
+ if (errflag) {
+ fprintf(stderr, brief_usage_msg);
+ return 3;
+ }
+
+ if (optind == argc) {
+ fprintf(stderr, "Specify the Ethernet address as 00:11:22:33:44:55.\n");
+ return 3;
+ }
+
+ /* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to
+ work as non-root, but we need SOCK_PACKET to specify the Ethernet
+ destination address. */
+#if defined(PF_PACKET)
+ s = socket(PF_PACKET, SOCK_RAW, 0);
+#else
+ s = socket(AF_INET, SOCK_PACKET, SOCK_PACKET);
+#endif
+ if (s < 0) {
+ if (errno == EPERM)
+ fprintf(stderr, "ether-wake: This program must be run as root.\n");
+ else
+ perror("ether-wake: socket");
+ perm_failure++;
+ }
+ /* Don't revert if debugging allows a normal user to get the raw socket. */
+ setuid(getuid());
+
+ /* We look up the station address before reporting failure so that
+ errors may be reported even when run as a normal user.
+ */
+ if (get_dest_addr(argv[optind], &eaddr) != 0)
+ return 3;
+ if (perm_failure && ! debug)
+ return 2;
+
+ pktsize = get_fill(outpack, &eaddr);
+
+ /* Fill in the source address, if possible.
+ The code to retrieve the local station address is Linux specific. */
+ if (! opt_no_src_addr) {
+ struct ifreq if_hwaddr;
+ unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
+
+ strcpy(if_hwaddr.ifr_name, ifname);
+ if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0) {
+ fprintf(stderr, "SIOCGIFHWADDR on %s failed: %s\n", ifname,
+ strerror(errno));
+ /* Magic packets still work if our source address is bogus, but
+ we fail just to be anal. */
+ return 1;
+ }
+ memcpy(outpack+6, if_hwaddr.ifr_hwad%s
>>> DIFF TRUNCATED @ 16K
More information about the Openembedded-commits
mailing list