net.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2001-2007 Willem Dijkstra
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * - Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * - Redistributions in binary form must reproduce the above
  12. * copyright notice, this list of conditions and the following
  13. * disclaimer in the documentation and/or other materials provided
  14. * with the distribution.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  19. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  20. * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  21. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  22. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  24. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  26. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  27. * POSSIBILITY OF SUCH DAMAGE.
  28. *
  29. */
  30. #ifndef _SYMON_LIB_NET_H
  31. #define _SYMON_LIB_NET_H
  32. #include <sys/queue.h>
  33. #include <sys/socket.h>
  34. #include <sys/types.h>
  35. #define SYMUX_PORT "2100" /* default symux port */
  36. extern char res_host[];
  37. extern char res_service[];
  38. extern struct sockaddr_storage res_addr;
  39. __BEGIN_DECLS
  40. int cmpsock_addr(struct sockaddr *, struct sockaddr *);
  41. int get_numeric_name(struct sockaddr_storage *);
  42. int getaddr(char *, char *, int, int);
  43. int getip(char *, int);
  44. int lookup(char *);
  45. void cpysock(struct sockaddr *, struct sockaddr_storage *);
  46. void get_sockaddr(struct sockaddr_storage *, int, int, int, char*, char *);
  47. void get_mux_sockaddr(struct mux *, int);
  48. int get_source_sockaddr(struct source *, int);
  49. __END_DECLS
  50. #endif /* _SYMON_LIB_NET_H */