cpl_nonsig.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * This file is part of ser, a free SIP server.
  7. *
  8. * ser is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version
  12. *
  13. * For a license to use the ser software under conditions
  14. * other than those described here, or to purchase support for this
  15. * software, please contact iptel.org by e-mail at the following addresses:
  16. * [email protected]
  17. *
  18. * ser is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  26. *
  27. * History:
  28. * -------
  29. * 2003-06-27: file created (bogdan)
  30. */
  31. #ifndef _CPL_NONSIG_H_
  32. #define _CPL_NONSIG_H_
  33. #include <unistd.h>
  34. #include "../../str.h"
  35. #include "cpl_env.h"
  36. struct cpl_cmd {
  37. unsigned int code;
  38. str s1;
  39. str s2;
  40. str s3;
  41. };
  42. #define CPL_LOG_CMD 1
  43. #define CPL_MAIL_CMD 2
  44. #define MAX_LOG_DIR_SIZE 256
  45. void cpl_aux_process( int cmd_out, char *log_dir);
  46. static inline void write_cpl_cmd(unsigned int code, str *s1, str *s2, str *s3)
  47. {
  48. static struct cpl_cmd cmd;
  49. cmd.code = code;
  50. cmd.s1 = *s1;
  51. cmd.s2 = *s2;
  52. cmd.s3 = *s3;
  53. if (write( cpl_env.cmd_pipe[1], &cmd, sizeof(struct cpl_cmd) )==-1)
  54. LOG(L_ERR,"ERROR:cpl_c:write_cpl_cmd: write ret: %s\n",
  55. strerror(errno));
  56. }
  57. #endif