diff options
author | Joe Hershberger | 2018-07-02 14:47:51 -0500 |
---|---|---|
committer | Joe Hershberger | 2018-07-26 14:08:18 -0500 |
commit | ac13270b49d55677aeea5a64dfbf1764118820e3 (patch) | |
tree | 2a8fe6eb4e638bb018f4f4661623fa47b553ccd0 /arch/sandbox/include/asm/eth-raw-os.h | |
parent | 8c7988b6dbfb0aa05a935e602b8cdb67f7dd60b2 (diff) |
sandbox: eth-raw: Add a function to ask the host about localhost
Instead of doing a simple string compare against "lo", look for the flag
that indicates a localhost interface.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/include/asm/eth-raw-os.h')
-rw-r--r-- | arch/sandbox/include/asm/eth-raw-os.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/sandbox/include/asm/eth-raw-os.h b/arch/sandbox/include/asm/eth-raw-os.h index 760f5fbedd1..edd09d2e084 100644 --- a/arch/sandbox/include/asm/eth-raw-os.h +++ b/arch/sandbox/include/asm/eth-raw-os.h @@ -34,6 +34,14 @@ struct eth_sandbox_raw_priv { unsigned short local_bind_udp_port; }; +/* + * Check if the interface named "ifname" is a localhost interface or not. + * ifname - the interface name on the host to check + * + * returns - 0 if real interface, 1 if local, negative if error + */ +int sandbox_eth_raw_os_is_local(const char *ifname); + int sandbox_eth_raw_os_start(struct eth_sandbox_raw_priv *priv, unsigned char *ethmac); int sandbox_eth_raw_os_send(void *packet, int length, |