What is the purpose of netmsg program?

While trying to determine resources for scripting in openwrt, I encountered a promising looking program called netmsg, which can send a UDP message from the command line. Fantastic idea. Problem it is hardwired to only send to port 0x1337, and hardwires x'dead' into the first two bytes of the (limited length) payload. Making what could be a useful general purpose program into specialized and not very generally useful "paperweight".
Is this program actually used in normal operation of openwrt? Would it be possible to remove the hard coding and just send an input message to any port? That way netmsg could be useful for many purposes.

Here's the link I followed in github to find the source code:

It is used for the failsafe indication broadcast message during boot (grep -r netmsg /lib/preinit/).

Netcat is what you are describing

Netcat - Wikipedia
https://en.m.wikipedia.org › wiki › Netcat


When I try using the netcat on openwrt it only seems to accept IP address and port, no visible option to use udp protocol. netcat seems to be very bare bones on openwrt, and consequently quite inflexible. What I don't understand about the netmsg program is what is listening for its message?

Many busybox applets are trimmed to "bare essentials" as somebody else describes what is "essential". Many times what is essential for me, isn't for busybox. OpenWRT often provides the "real" application as a package.



1 Like

Users, with tcpdump or wireshark.