Network.hx 760 B

123456789101112131415161718192021222324252627282930313233343536
  1. package eval.luv;
  2. typedef InterfaceAddress = {
  3. var name:String;
  4. var isInternal:Bool;
  5. var physical:NativeString;
  6. var address:SockAddr;
  7. var netmask:SockAddr;
  8. }
  9. /**
  10. Network interfaces and hostname.
  11. @see https://aantron.github.io/luv/luv/Luv/Network
  12. **/
  13. extern class Network {
  14. /**
  15. Lists network interface addresses.
  16. **/
  17. static function interfaceAddresses():Result<Array<InterfaceAddress>>;
  18. /**
  19. Retrieves a network interface name.
  20. **/
  21. static function ifIndexToName(index:Int):Result<String>;
  22. /**
  23. Retrieves a network interface identifier suitable for use in an IPv6 scoped address.
  24. **/
  25. static function ifIndexToIid(index:Int):Result<String>;
  26. /**
  27. Evaluates to the system's hostname.
  28. **/
  29. static function getHostName():Result<String>;
  30. }