eth-raw-os.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2015 National Instruments
  3. *
  4. * (C) Copyright 2015
  5. * Joe Hershberger <joe.hershberger@ni.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0
  8. */
  9. #ifndef __ETH_RAW_OS_H
  10. #define __ETH_RAW_OS_H
  11. /**
  12. * struct eth_sandbox_raw_priv - raw socket session
  13. *
  14. * sd: socket descriptor - the open socket during a session
  15. * device: struct sockaddr_ll - the host interface packets move to/from
  16. * local: 1 or 0 to select the local interface ('lo') or not
  17. * local_bindsd: socket descriptor to prevent the kernel from sending
  18. * a message to the server claiming the port is
  19. * unreachable
  20. * local_bind_udp_port: The UDP port number that we bound to
  21. */
  22. struct eth_sandbox_raw_priv {
  23. int sd;
  24. void *device;
  25. int local;
  26. int local_bind_sd;
  27. unsigned short local_bind_udp_port;
  28. };
  29. int sandbox_eth_raw_os_start(const char *ifname, unsigned char *ethmac,
  30. struct eth_sandbox_raw_priv *priv);
  31. int sandbox_eth_raw_os_send(void *packet, int length,
  32. struct eth_sandbox_raw_priv *priv);
  33. int sandbox_eth_raw_os_recv(void *packet, int *length,
  34. const struct eth_sandbox_raw_priv *priv);
  35. void sandbox_eth_raw_os_stop(struct eth_sandbox_raw_priv *priv);
  36. #endif /* __ETH_RAW_OS_H */