eth-raw-os.h 1.2 KB

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