NativeInterface.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package org.siprouter;
  2. import java.lang.*;
  3. public interface NativeInterface
  4. {
  5. public abstract class Ranks
  6. {
  7. public static final int PROC_MAIN = 0; // Main ser process
  8. public static final int PROC_TIMER = -1; // Timer attendant process
  9. public static final int PROC_RPC = -2; // RPC type process
  10. public static final int PROC_FIFO = PROC_RPC; // FIFO attendant process
  11. public static final int PROC_TCP_MAIN = -4; // TCP main process
  12. public static final int PROC_UNIXSOCK = -5; // Unix socket server
  13. public static final int PROC_ATTENDANT = -10; // main "attendant process
  14. public static final int PROC_INIT = -127; /* special rank, the context is the main ser process, but this is
  15. guaranteed to be executed before any rocess is forked, so it
  16. can be used to setup shared variables that depend on some
  17. after mod_init available information (e.g. total number of processes).
  18. @warning child_init(PROC_MAIN) is again called in the same process (main)
  19. (before tcp), so make sure you don't init things twice, bot in PROC_MAIN and PROC_INT
  20. */
  21. public static final int PROC_NOCHLDINIT = -128; // no child init functions will be called if this rank is used in fork_process()
  22. public static final int PROC_SIPINIT = 1; // First SIP worker - some modules do special processing in this child, like loading db data
  23. public static final int PROC_SIPRPC = 127; /* Used to init RPC worker as SIP commands handler.
  24. Don't do any special processing in the child init with this rank - just bare child initialization
  25. */
  26. public static final int PROC_MIN = PROC_NOCHLDINIT; // Minimum process rank
  27. }
  28. public abstract class LogParams
  29. {
  30. public static final int L_ALERT = -5;
  31. public static final int L_BUG = -4;
  32. public static final int L_CRIT2 = -3; // like L_CRIT, but adds prefix
  33. public static final int L_CRIT = -2; // no prefix added
  34. public static final int L_ERR = -1;
  35. public static final int L_WARN = 0;
  36. public static final int L_NOTICE = 1;
  37. public static final int L_INFO = 2;
  38. public static final int L_DBG = 3;
  39. public static final int DEFAULT_FACILITY = 0;
  40. }
  41. }