unixsock_server.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * $Id$
  3. *
  4. * UNIX Domain Socket Server
  5. *
  6. * Copyright (C) 2001-2004 FhG Fokus
  7. * Copyright (C) 2005 iptelorg GmbH
  8. *
  9. * This file is part of ser, a free SIP server.
  10. *
  11. * ser is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version
  15. *
  16. * For a license to use the ser software under conditions
  17. * other than those described here, or to purchase support for this
  18. * software, please contact iptel.org by e-mail at the following addresses:
  19. * [email protected]
  20. *
  21. * ser is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  29. */
  30. #ifndef _UNIXSOCK_SERVER_H
  31. #define _UNIXSOCK_SERVER_H
  32. #include <sys/types.h>
  33. #include <sys/un.h>
  34. #include <unistd.h>
  35. #include "../../str.h"
  36. extern char* unixsock_name;
  37. extern char* unixsock_user;
  38. extern char* unixsock_mode;
  39. extern char* unixsock_group;
  40. extern unsigned int unixsock_children;
  41. extern unsigned int unixsock_tx_timeout;
  42. /*
  43. * Initialize Unix domain socket server
  44. */
  45. int init_unixsock_socket(void);
  46. /*
  47. * Initialize Unix domain socket server
  48. */
  49. int init_unixsock_children(void);
  50. /*
  51. * Clean up
  52. */
  53. void close_unixsock_server(void);
  54. /*
  55. * Send the reply
  56. */
  57. ssize_t unixsock_reply_send(void);
  58. /*
  59. * Send the reply to the given destination
  60. */
  61. ssize_t unixsock_reply_sendto(struct sockaddr_un* to);
  62. /*
  63. * Return the address of the sender
  64. */
  65. struct sockaddr_un* unixsock_sender_addr(void);
  66. void unixsock_reply_reset(void);
  67. #endif /* _UNIXSOCK_SERVER_H */