module_method_t method; //!< Module method to call
call_env_method_t const *method_env; //!< Method specific call_env.
- fr_dlist_head_t name2_list; //!< List of bindings with the same name1. Only initialised
+ fr_dlist_head_t same_name1; //!< List of bindings with the same name1. Only initialised
///< for the the first name1 binding.
///< DO NOT INITIALISE IN THE MODULE.
- fr_dlist_t name2_entry; //!< Linked list of bindings with the same name1.
+ fr_dlist_t entry; //!< Linked list of bindings with the same name1.
///< Allows us to more quickly iterate over all
///< name2 entries after finding a matching name1.
///< This is also temporarily used to verify the ordering
mrlm = module_rlm_from_module(mi->exported);
- fr_dlist_init(&bindings, module_method_binding_t, name2_entry);
+ fr_dlist_init(&bindings, module_method_binding_t, entry);
/*
* Not all modules export module method bindings
)
)
) {
- fr_dlist_init(&p->name2_list, module_method_binding_t, name2_entry);
+ fr_dlist_init(&p->same_name1, module_method_binding_t, entry);
last_binding = p;
}
- fr_dlist_insert_tail(&last_binding->name2_list, p);
+ fr_dlist_insert_tail(&last_binding->same_name1, p);
}
}
return CMP(strcmp(a->name2, b->name2), 0);
}
-
-/* Compare two section names
- *
- * Respects CF_IDENT_ANY values
- *
- * @param[in] a First section name.
- * @param[in] b Second section name.
- *
- * @return true if the section names match, false otherwise.
- */
-bool section_name_match(section_name_t const *a, section_name_t const *b)
-{
- if ((a->name1 == CF_IDENT_ANY) || (b->name2 == CF_IDENT_ANY)) goto name2;
-
- if (strcmp(a->name1, b->name1) != 0) return false;
-
-name2:
- if ((a->name2 == CF_IDENT_ANY) || (b->name2 == CF_IDENT_ANY)) return true;
-
- return (strcmp(a->name2, b->name2) == 0);
-}
RCSIDH(section_h, "$Id$")
#include <stdbool.h>
+#include <freeradius-devel/server/cf_util.h>
#ifdef __cplusplus
extern "C" {
char const *name2; //!< Second section name. Usually a packet type like 'access-request', 'access-accept', etc...
} section_name_t;
-int8_t section_name_cmp(void const *one, void const *two);
+/* Compare two sections based on name2
+ *
+ * Respects CF_IDENT_ANY values
+ *
+ * @param[in] a First section name.
+ * @param[in] b Second section name.
+ *
+ * @return
+ * - 1 if name2 values match.
+ * - 0 if name2 values don't match.
+ */
+static inline int section_name2_match(section_name_t const *a, section_name_t const *b)
+{
+ if ((a->name2 == CF_IDENT_ANY) || (b->name2 == CF_IDENT_ANY)) return 1;
+
+ return (strcmp(a->name2, b->name2) == 0) ? 1 : 0;
+}
+
+/* Compare two section names
+ *
+ * Respects CF_IDENT_ANY values
+ *
+ * @param[in] a First section name.
+ * @param[in] b Second section name.
+ *
+ * @return
+ * - 1 if the section names match.
+ * - 0 if the section names don't match.
+ * - -1 if name1 doesn't match.
+ *
+ */
+static inline int section_name_match(section_name_t const *a, section_name_t const *b)
+{
+ if ((a->name1 == CF_IDENT_ANY) || (b->name2 == CF_IDENT_ANY)) goto name2;
+
+ if (strcmp(a->name1, b->name1) != 0) return -1;
-bool section_name_match(section_name_t const *a, section_name_t const *b);
+name2:
+ return section_name2_match(a, b);
+}
#ifdef __cplusplus
}