procd.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2013 Felix Fietkau <nbd@openwrt.org>
  3. * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License version 2.1
  7. * as published by the Free Software Foundation
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef __PROCD_H
  15. #define __PROCD_H
  16. #include <libubox/uloop.h>
  17. #include <libubox/utils.h>
  18. #include <libubus.h>
  19. #include <udebug.h>
  20. #include <stdio.h>
  21. #include <syslog.h>
  22. #include "log.h"
  23. #define __init __attribute__((constructor))
  24. extern char *ubus_socket;
  25. void procd_connect_ubus(void);
  26. void procd_reconnect_ubus(int reconnect);
  27. void ubus_init_hotplug(struct ubus_context *ctx);
  28. void ubus_init_service(struct ubus_context *ctx);
  29. void ubus_init_system(struct ubus_context *ctx);
  30. void procd_state_next(void);
  31. void procd_state_ubus_connect(void);
  32. void procd_shutdown(int event);
  33. void procd_early(void);
  34. void procd_preinit(void);
  35. void procd_signal(void);
  36. void procd_signal_preinit(void);
  37. void procd_inittab(void);
  38. void procd_inittab_run(const char *action);
  39. void procd_inittab_kill(void);
  40. void procd_bcast_event(char *event, struct blob_attr *msg);
  41. struct trigger;
  42. void trigger_event(const char *type, struct blob_attr *data);
  43. void trigger_add(struct blob_attr *rule, void *id);
  44. void trigger_del(void *id);
  45. void watch_add(const char *_name, void *id);
  46. void watch_del(void *id);
  47. void watch_ubus(struct ubus_context *ctx);
  48. void procd_udebug_printf(const char *format, ...);
  49. void procd_udebug_set_enabled(bool val);
  50. #endif