1 Index: busybox-1.7.2/include/applets.h
2 ===================================================================
3 --- busybox-1.7.2.orig/include/applets.h 2007-10-30 15:34:59.000000000 -0500
4 +++ busybox-1.7.2/include/applets.h 2007-10-30 15:35:03.000000000 -0500
6 USE_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_NEVER))
7 USE_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_NEVER))
8 USE_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
9 +USE_NETMSG(APPLET_NOUSAGE(netmsg, netmsg, _BB_DIR_BIN, _BB_SUID_ALWAYS))
10 USE_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_NEVER))
11 USE_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_NEVER))
12 USE_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
13 Index: busybox-1.7.2/networking/Config.in
14 ===================================================================
15 --- busybox-1.7.2.orig/networking/Config.in 2007-10-30 15:34:59.000000000 -0500
16 +++ busybox-1.7.2/networking/Config.in 2007-10-30 15:35:03.000000000 -0500
19 A simple Unix utility which reads and writes data across network
26 + simple program for sending udp broadcast messages
29 bool "Netcat server options (-l)"
30 Index: busybox-1.7.2/networking/Kbuild
31 ===================================================================
32 --- busybox-1.7.2.orig/networking/Kbuild 2007-10-30 15:34:59.000000000 -0500
33 +++ busybox-1.7.2/networking/Kbuild 2007-10-30 15:35:03.000000000 -0500
35 lib-$(CONFIG_IPCALC) += ipcalc.o
36 lib-$(CONFIG_NAMEIF) += nameif.o
37 lib-$(CONFIG_NC) += nc.o
38 +lib-$(CONFIG_NETMSG) += netmsg.o
39 lib-$(CONFIG_NETSTAT) += netstat.o
40 lib-$(CONFIG_NSLOOKUP) += nslookup.o
41 lib-$(CONFIG_PING) += ping.o
42 Index: busybox-1.7.2/networking/netmsg.c
43 ===================================================================
44 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
45 +++ busybox-1.7.2/networking/netmsg.c 2007-10-30 15:35:03.000000000 -0500
48 + * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
50 + * This is free software, licensed under the GNU General Public License v2.
52 +#include <sys/types.h>
53 +#include <sys/socket.h>
54 +#include <netinet/in.h>
62 +#ifndef CONFIG_NETMSG
63 +int main(int argc, char **argv)
65 +int netmsg_main(int argc, char **argv)
69 + struct sockaddr_in addr;
71 + unsigned char buf[1001];
74 + fprintf(stderr, "usage: %s <ip> \"<message>\"\n", argv[0]);
78 + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
79 + perror("Opening socket");
83 + memset(&addr, 0, sizeof(addr));
84 + addr.sin_family = AF_INET;
85 + addr.sin_addr.s_addr = inet_addr(argv[1]);
86 + addr.sin_port = htons(0x1337);
88 + memset(buf, 0, 1001);
92 + strncpy(buf + 2, argv[2], 998);
94 + if (setsockopt (s, SOL_SOCKET, SO_BROADCAST, (caddr_t) &optval, sizeof (optval)) < 0) {
95 + perror("setsockopt()");
99 + if (sendto(s, buf, 1001, 0, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
100 + perror("sendto()");