Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / modules.h
index 6b8e211..dbb17f3 100644 (file)
@@ -13,6 +13,10 @@ RCSIDH(modules_h, "$Id$")
 
 #include <freeradius-devel/conffile.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef int (*packetmethod)(void *instance, REQUEST *request);
 
 enum {
@@ -24,7 +28,11 @@ enum {
   RLM_COMPONENT_PRE_PROXY,     /* 5 */
   RLM_COMPONENT_POST_PROXY,    /* 6 */
   RLM_COMPONENT_POST_AUTH,     /* 7 */
-  RLM_COMPONENT_COUNT          /* 8: How many components are there */
+#ifdef WITH_COA
+  RLM_COMPONENT_RECV_COA,      /* 8 */
+  RLM_COMPONENT_SEND_COA,      /* 9 */
+#endif
+  RLM_COMPONENT_COUNT          /* 8 / 10: How many components are there */
 };
 
 #define RLM_TYPE_THREAD_SAFE           (0 << 0)
@@ -32,7 +40,7 @@ enum {
 #define RLM_TYPE_CHECK_CONFIG_SAFE     (1 << 1)
 #define RLM_TYPE_HUP_SAFE              (1 << 2)
 
-#define RLM_MODULE_MAGIC_NUMBER ((uint32_t) (0xf4ee4ad2))
+#define RLM_MODULE_MAGIC_NUMBER ((uint32_t) (0xf4ee4ad3))
 #define RLM_MODULE_INIT RLM_MODULE_MAGIC_NUMBER
 
 typedef struct module_t {
@@ -68,6 +76,13 @@ int module_checksimul(int type, REQUEST *request, int maxsimul);
 int module_pre_proxy(int type, REQUEST *request);
 int module_post_proxy(int type, REQUEST *request);
 int module_post_auth(int type, REQUEST *request);
+#ifdef WITH_COA
+int module_recv_coa(int type, REQUEST *request);
+int module_send_coa(int type, REQUEST *request);
+#define MODULE_NULL_COA_FUNCS ,NULL,NULL
+#else
+#define MODULE_NULL_COA_FUNCS
+#endif
 int indexed_modcall(int comp, int idx, REQUEST *request);
 
 /*
@@ -76,5 +91,8 @@ int indexed_modcall(int comp, int idx, REQUEST *request);
 int virtual_servers_load(CONF_SECTION *config);
 void virtual_servers_free(time_t when);
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* RADIUS_MODULES_H */