Add xtables.c and xtables.h
In order to support the compilation of third-party utils, we encounter some
situations where the macro is not defined, refer to the common implementation
of other systems, add relevant definitions and empty function.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Socket binded to INADDR_ANY is not intended to receive unicast traffic before being fully configured, at least dhclient configured with socket-only won't do so on Linux and BSDs (https://github.com/isc-projects/dhcp/blob/v4_4_3/common/socket.c#L1201).
We can sometimes receive unicast traffic before being fully configured, it's good, but not always, so we need to set the broadcast flag under some situations.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Add missing FAR and CODE to pointers
Remove FAR for non-pointer variables
Remove extra spaces and align the parameters
Add do {} while(0) wrapper in macro
Use nitems to calculate number of elements in arrays
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
In dns_add_nameserver, the dns_check_nameserver is comparing addresses
with addrlen = sizeof(struct sockaddr_in) for IPv4 addresses, so the
trailing sin_zero field should be 0, otherwise it may fail to figure out
same nameserver address.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
The flag '-Wno-maybe-uninitialized' is not known by clang, so a
workaround substitutes it for '-Wno-uninitialized' when clang is
being used as C compiler.
Usage:
iperf -s --rpmsg <name>
iperf -c <cpu> --rpmsg <name>
Note:
RPMsg with SOCK_DGRAM (`-u`) doesn't have server mode (bind) yet, iperf
may not work in this case before rpsock is enhanced.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Usage:
iperf -s --local <path>
iperf -c <path> --local || iperf -c <whatever> --local <path>
Can combine with other options, e.g. '-u' will result in local
UDP (DGRAM).
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
We'll add local/rpmsg sockets later, they're mainly different in
sockaddr, we can reuse other current logic.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Argtable's builtin glossary can produce same output and we do not need
to maintain two sets of help string. Then we're easier to add more
options to iperf.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
The timer is for connect timeout, but is not cancelled on connect error,
then it may be triggered after ftpc quit and cause heap-use-after-free.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>