1 --- a/include/applets.src.h
2 +++ b/include/applets.src.h
3 @@ -278,6 +278,7 @@ IF_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_D
4 IF_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_DROP))
5 IF_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_DROP))
6 IF_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_DROP))
7 +IF_NETMSG(APPLET(netmsg, _BB_DIR_BIN, _BB_SUID_REQUIRE))
8 IF_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_DROP))
9 IF_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_DROP))
10 IF_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_DROP))
11 --- a/networking/Config.src
12 +++ b/networking/Config.src
13 @@ -623,6 +623,12 @@ config FEATURE_NAMEIF_EXTENDED
14 new_interface_name mac=00:80:C8:38:91:B5
15 new_interface_name 00:80:C8:38:91:B5
21 + simple program for sending udp broadcast messages
26 --- a/networking/Kbuild.src
27 +++ b/networking/Kbuild.src
28 @@ -27,6 +27,7 @@ lib-$(CONFIG_IP) += ip.o
29 lib-$(CONFIG_IPCALC) += ipcalc.o
30 lib-$(CONFIG_NAMEIF) += nameif.o
31 lib-$(CONFIG_NC) += nc.o
32 +lib-$(CONFIG_NETMSG) += netmsg.o
33 lib-$(CONFIG_NETSTAT) += netstat.o
34 lib-$(CONFIG_NSLOOKUP) += nslookup.o
35 lib-$(CONFIG_NTPD) += ntpd.o
37 +++ b/networking/netmsg.c
40 + * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
42 + * This is free software, licensed under the GNU General Public License v2.
44 +#include <sys/types.h>
45 +#include <sys/socket.h>
46 +#include <netinet/in.h>
54 +#ifndef CONFIG_NETMSG
55 +int main(int argc, char **argv)
57 +int netmsg_main(int argc, char **argv)
61 + struct sockaddr_in addr;
63 + unsigned char buf[1001];
66 + fprintf(stderr, "usage: %s <ip> \"<message>\"\n", argv[0]);
70 + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
71 + perror("Opening socket");
75 + memset(&addr, 0, sizeof(addr));
76 + addr.sin_family = AF_INET;
77 + addr.sin_addr.s_addr = inet_addr(argv[1]);
78 + addr.sin_port = htons(0x1337);
80 + memset(buf, 0, 1001);
84 + strncpy(buf + 2, argv[2], 998);
86 + if (setsockopt (s, SOL_SOCKET, SO_BROADCAST, (caddr_t) &optval, sizeof (optval)) < 0) {
87 + perror("setsockopt()");
91 + if (sendto(s, buf, 1001, 0, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
102 --- a/include/usage.src.h
103 +++ b/include/usage.src.h
106 /* vi: set sw=8 ts=8: */
108 * This file suffers from chronically incorrect tabification
109 @@ -2961,6 +2962,9 @@ INSERT
111 "$ nameif -c /etc/my_mactab_file\n" \
113 +#define netmsg_trivial_usage NOUSAGE_STR
114 +#define netmsg_full_usage ""
116 #define netstat_trivial_usage \
117 "[-laentuwxr"IF_FEATURE_NETSTAT_WIDE("W")IF_FEATURE_NETSTAT_PRG("p")"]"
118 #define netstat_full_usage "\n\n" \