From: Arran Cudbard-Bell Date: Tue, 3 Nov 2020 22:03:38 +0000 (-0600) Subject: s/RADIUS_PACKET/fr_radius_packet_t/ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3abd9a8100b8ce5977ddda03a66a89fa3f1238c;p=thirdparty%2Ffreeradius-server.git s/RADIUS_PACKET/fr_radius_packet_t/ --- diff --git a/src/bin/radclient.c b/src/bin/radclient.c index 672bf60a95b..76c05f98c92 100644 --- a/src/bin/radclient.c +++ b/src/bin/radclient.c @@ -190,7 +190,7 @@ static int _rc_request_free(rc_request_t *request) return 0; } -static int mschapv1_encode(RADIUS_PACKET *packet, fr_pair_t **request, +static int mschapv1_encode(fr_radius_packet_t *packet, fr_pair_t **request, char const *password) { unsigned int i; @@ -942,7 +942,7 @@ static int recv_one_packet(fr_time_t wait_time) fd_set set; fr_time_delta_t our_wait_time; rc_request_t *request; - RADIUS_PACKET *reply, **packet_p; + fr_radius_packet_t *reply, **packet_p; volatile int max_fd; /* And wait for reply, timing out as necessary */ diff --git a/src/bin/radclient.h b/src/bin/radclient.h index a27e38da39f..25173b10190 100644 --- a/src/bin/radclient.h +++ b/src/bin/radclient.h @@ -77,8 +77,8 @@ struct rc_request { fr_pair_t *password; //!< Cleartext-Password fr_time_delta_t timestamp; - RADIUS_PACKET *packet; //!< The outgoing request. - RADIUS_PACKET *reply; //!< The incoming response. + fr_radius_packet_t *packet; //!< The outgoing request. + fr_radius_packet_t *reply; //!< The incoming response. fr_pair_t *filter; //!< If the reply passes the filter, then the request passes. FR_CODE filter_code; //!< Expected code of the response packet. diff --git a/src/bin/radsniff.c b/src/bin/radsniff.c index e29fb9e761f..95ca25913f6 100644 --- a/src/bin/radsniff.c +++ b/src/bin/radsniff.c @@ -304,7 +304,7 @@ static void rs_packet_print_csv_header(void) fprintf(stdout , "%s\n", buffer); } -static void rs_packet_print_csv(uint64_t count, rs_status_t status, fr_pcap_t *handle, RADIUS_PACKET *packet, +static void rs_packet_print_csv(uint64_t count, rs_status_t status, fr_pcap_t *handle, fr_radius_packet_t *packet, UNUSED struct timeval *elapsed, struct timeval *latency, UNUSED bool response, bool body) { @@ -377,7 +377,7 @@ static void rs_packet_print_csv(uint64_t count, rs_status_t status, fr_pcap_t *h fprintf(stdout , "%s\n", buffer); } -static void rs_packet_print_fancy(uint64_t count, rs_status_t status, fr_pcap_t *handle, RADIUS_PACKET *packet, +static void rs_packet_print_fancy(uint64_t count, rs_status_t status, fr_pcap_t *handle, fr_radius_packet_t *packet, struct timeval *elapsed, struct timeval *latency, bool response, bool body) { char buffer[2048]; @@ -473,7 +473,7 @@ static void rs_packet_print_fancy(uint64_t count, rs_status_t status, fr_pcap_t } static inline void rs_packet_print(rs_request_t *request, uint64_t count, rs_status_t status, fr_pcap_t *handle, - RADIUS_PACKET *packet, struct timeval *elapsed, struct timeval *latency, + fr_radius_packet_t *packet, struct timeval *elapsed, struct timeval *latency, bool response, bool body) { if (!conf->logger) return; @@ -1008,7 +1008,7 @@ static int _request_free(rs_request_t *request) static void rs_packet_cleanup(rs_request_t *request) { - RADIUS_PACKET *packet = request->packet; + fr_radius_packet_t *packet = request->packet; uint64_t count = request->id; RS_ASSERT(request->stats_req); @@ -1207,7 +1207,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt static uint64_t captured = 0; rs_status_t status = RS_NORMAL; /* Any special conditions (RTX, Unlinked, ID-Reused) */ - RADIUS_PACKET *packet; /* Current packet were processing */ + fr_radius_packet_t *packet; /* Current packet were processing */ rs_request_t *original = NULL; rs_request_t search; diff --git a/src/bin/radsniff.h b/src/bin/radsniff.h index 08d478a133e..9348b084814 100644 --- a/src/bin/radsniff.h +++ b/src/bin/radsniff.h @@ -75,7 +75,7 @@ typedef enum { RS_LOST = 0x20 } rs_status_t; -typedef void (*rs_packet_logger_t)(uint64_t count, rs_status_t status, fr_pcap_t *handle, RADIUS_PACKET *packet, +typedef void (*rs_packet_logger_t)(uint64_t count, rs_status_t status, fr_pcap_t *handle, fr_radius_packet_t *packet, struct timeval *elapsed, struct timeval *latency, bool response, bool body); typedef enum { #ifdef HAVE_COLLECTDC_H @@ -175,7 +175,7 @@ typedef struct { uint8_t *data; //!< PCAP packet data. } rs_capture_t; -/** Wrapper for RADIUS_PACKET +/** Wrapper for fr_radius_packet_t * * Allows an event to be associated with a request packet. This is required because we need to disarm * the event timer when a response is received, so we don't erroneously log the response as lost. @@ -189,9 +189,9 @@ typedef struct { struct timeval when; //!< Time when the packet was received, or next time an event //!< is scheduled. fr_pcap_t *in; //!< PCAP handle the original request was received on. - RADIUS_PACKET *packet; //!< The original packet. - RADIUS_PACKET *expect; //!< Request/response. - RADIUS_PACKET *linked; //!< The subsequent response or forwarded request the packet + fr_radius_packet_t *packet; //!< The original packet. + fr_radius_packet_t *expect; //!< Request/response. + fr_radius_packet_t *linked; //!< The subsequent response or forwarded request the packet //!< was linked against. diff --git a/src/bin/radsnmp.c b/src/bin/radsnmp.c index 89f5e9ab314..a6265bf25a6 100644 --- a/src/bin/radsnmp.c +++ b/src/bin/radsnmp.c @@ -159,9 +159,9 @@ static void rs_signal_stop(UNUSED int sig) * @param fd the request will be sent on. * @return new request. */ -static RADIUS_PACKET *radsnmp_alloc(radsnmp_conf_t *conf, int fd) +static fr_radius_packet_t *radsnmp_alloc(radsnmp_conf_t *conf, int fd) { - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; packet = fr_radius_alloc(conf, true); @@ -646,7 +646,7 @@ static int radsnmp_send_recv(radsnmp_conf_t *conf, int fd) fr_cursor_t cursor; fr_pair_t *vp; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; /* * Alloc a new packet so we can start adding @@ -763,7 +763,7 @@ static int radsnmp_send_recv(radsnmp_conf_t *conf, int fd) * Send the packet */ { - RADIUS_PACKET *reply = NULL; + fr_radius_packet_t *reply = NULL; ssize_t rcode; fd_set set; diff --git a/src/bin/unit_test_module.c b/src/bin/unit_test_module.c index b40526876c3..bf2c7c2b32b 100644 --- a/src/bin/unit_test_module.c +++ b/src/bin/unit_test_module.c @@ -294,7 +294,7 @@ static request_t *request_from_file(TALLOC_CTX *ctx, FILE *fp, fr_event_list_t * } -static void print_packet(FILE *fp, RADIUS_PACKET *packet) +static void print_packet(FILE *fp, fr_radius_packet_t *packet) { fr_pair_t *vp; fr_cursor_t cursor; diff --git a/src/lib/eap/base.c b/src/lib/eap/base.c index 5b279337cc2..9a4ae4a7cc4 100644 --- a/src/lib/eap/base.c +++ b/src/lib/eap/base.c @@ -115,7 +115,7 @@ fr_dict_attr_autoload_t eap_base_dict_attr[] = { { NULL } }; -fr_pair_t *eap_packet_to_vp(RADIUS_PACKET *packet, eap_packet_raw_t const *eap) +fr_pair_t *eap_packet_to_vp(fr_radius_packet_t *packet, eap_packet_raw_t const *eap) { int total, size; uint8_t const *ptr; diff --git a/src/lib/eap/base.h b/src/lib/eap/base.h index fc8d8ba6afa..fd6744f6027 100644 --- a/src/lib/eap/base.h +++ b/src/lib/eap/base.h @@ -68,7 +68,7 @@ typedef struct { /* * interfaces in eapcommon.c */ -fr_pair_t *eap_packet_to_vp(RADIUS_PACKET *packet, eap_packet_raw_t const *reply); +fr_pair_t *eap_packet_to_vp(fr_radius_packet_t *packet, eap_packet_raw_t const *reply); eap_packet_raw_t *eap_packet_from_vp(TALLOC_CTX *ctx, fr_pair_t *vps); void eap_add_reply(request_t *request, fr_dict_attr_t const *da, uint8_t const *value, int len); diff --git a/src/lib/eap/chbind.c b/src/lib/eap/chbind.c index 45499669345..ed933f48081 100644 --- a/src/lib/eap/chbind.c +++ b/src/lib/eap/chbind.c @@ -301,7 +301,7 @@ chbind_packet_t *eap_chbind_vp2packet(TALLOC_CTX *ctx, fr_pair_t *vps) return packet; } -fr_pair_t *eap_chbind_packet2vp(RADIUS_PACKET *packet, chbind_packet_t *chbind) +fr_pair_t *eap_chbind_packet2vp(fr_radius_packet_t *packet, chbind_packet_t *chbind) { fr_pair_t *vp; diff --git a/src/lib/eap/chbind.h b/src/lib/eap/chbind.h index 3362c38c513..933c606f7d4 100644 --- a/src/lib/eap/chbind.h +++ b/src/lib/eap/chbind.h @@ -57,5 +57,5 @@ typedef struct { /* Channel binding function prototypes */ FR_CODE chbind_process(request_t *request, CHBIND_REQ *chbind_req); -fr_pair_t *eap_chbind_packet2vp(RADIUS_PACKET *packet, chbind_packet_t *chbind); +fr_pair_t *eap_chbind_packet2vp(fr_radius_packet_t *packet, chbind_packet_t *chbind); chbind_packet_t *eap_chbind_vp2packet(TALLOC_CTX *ctx, fr_pair_t *vps); diff --git a/src/lib/server/auth.c b/src/lib/server/auth.c index 9cc187fb281..666c5a88fd2 100644 --- a/src/lib/server/auth.c +++ b/src/lib/server/auth.c @@ -183,7 +183,7 @@ runit: /* * Debug the packet if requested. */ -void common_packet_debug(request_t *request, RADIUS_PACKET *packet, bool received) +void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { #if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) char if_name[IFNAMSIZ]; diff --git a/src/lib/server/listen.h b/src/lib/server/listen.h index 0de5bb0c294..7d315ba818e 100644 --- a/src/lib/server/listen.h +++ b/src/lib/server/listen.h @@ -69,7 +69,7 @@ typedef int (*rad_listen_recv_t)(rad_listen_t *); typedef int (*rad_listen_send_t)(rad_listen_t *, request_t *); typedef int (*rad_listen_error_t)(rad_listen_t *, int); typedef int (*rad_listen_print_t)(rad_listen_t const *, char *, size_t); -typedef void (*rad_listen_debug_t)(request_t *, RADIUS_PACKET *, bool received); +typedef void (*rad_listen_debug_t)(request_t *, fr_radius_packet_t *, bool received); typedef int (*rad_listen_encode_t)(rad_listen_t *, request_t *); typedef int (*rad_listen_decode_t)(rad_listen_t *, request_t *); @@ -154,7 +154,7 @@ typedef struct { struct listen_socket_t *parent; RADCLIENT *client; - RADIUS_PACKET *packet; /* for reading partial packets */ + fr_radius_packet_t *packet; /* for reading partial packets */ #if 0 fr_tls_session_t *tls_session; diff --git a/src/lib/server/main_config.c b/src/lib/server/main_config.c index 577d3abd86e..19ca35a6db2 100644 --- a/src/lib/server/main_config.c +++ b/src/lib/server/main_config.c @@ -924,7 +924,7 @@ int main_config_init(main_config_t *config) INFO("Starting - reading configuration files ..."); /* - * About sizeof(request_t) + sizeof(RADIUS_PACKET) * 2 + sizeof(fr_pair_t) * 400 + * About sizeof(request_t) + sizeof(fr_radius_packet_t) * 2 + sizeof(fr_pair_t) * 400 * * Which should be enough for many configurations. */ diff --git a/src/lib/server/protocol.c b/src/lib/server/protocol.c index d4162e8e0bf..db415f12293 100644 --- a/src/lib/server/protocol.c +++ b/src/lib/server/protocol.c @@ -37,7 +37,7 @@ extern "C" { /* * Debug the packet if requested. */ -void common_packet_debug(request_t *request, RADIUS_PACKET *packet, bool received) +void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { #if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) char if_name[IFNAMSIZ]; diff --git a/src/lib/server/protocol.h b/src/lib/server/protocol.h index 68a2112a1ca..3900828012c 100644 --- a/src/lib/server/protocol.h +++ b/src/lib/server/protocol.h @@ -47,7 +47,7 @@ typedef void (*rad_listen_free_t)(rad_listen_t *); int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this); int common_socket_open(CONF_SECTION *cs, rad_listen_t *this); int common_socket_print(rad_listen_t const *this, char *buffer, size_t bufsize); -void common_packet_debug(request_t *request, RADIUS_PACKET *packet, bool received); +void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received); /** Struct exported by a proto_* module * diff --git a/src/lib/server/request.c b/src/lib/server/request.c index d23955b5399..8e7252981ac 100644 --- a/src/lib/server/request.c +++ b/src/lib/server/request.c @@ -259,7 +259,7 @@ request_t *_request_alloc(char const *file, int line, TALLOC_CTX *ctx) 2 + /* packets */ 10, /* extra */ (UNLANG_FRAME_PRE_ALLOC * UNLANG_STACK_MAX) + /* Stack memory */ - (sizeof(RADIUS_PACKET) * 2) + /* packets */ + (sizeof(fr_radius_packet_t) * 2) + /* packets */ 128 /* extra */ )); talloc_set_destructor(request, _request_free); @@ -496,11 +496,11 @@ int request_detach(request_t *fake, bool will_free) /* * Verify a packet. */ -static void packet_verify(char const *file, int line, request_t const *request, RADIUS_PACKET const *packet, char const *type) +static void packet_verify(char const *file, int line, request_t const *request, fr_radius_packet_t const *packet, char const *type) { TALLOC_CTX *parent; - fr_fatal_assert_msg(packet, "CONSISTENCY CHECK FAILED %s[%i]: RADIUS_PACKET %s pointer was NULL", + fr_fatal_assert_msg(packet, "CONSISTENCY CHECK FAILED %s[%i]: fr_radius_packet_t %s pointer was NULL", file, line, type); parent = talloc_parent(packet); @@ -509,7 +509,7 @@ static void packet_verify(char const *file, int line, request_t const *request, if (parent) fr_log_talloc_report(parent); - fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%i]: Expected RADIUS_PACKET %s to be parented " + fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%i]: Expected fr_radius_packet_t %s to be parented " "by %p (%s), but parented by %p (%s)", file, line, type, request, talloc_get_name(request), parent, parent ? talloc_get_name(parent) : "NULL"); diff --git a/src/lib/server/request.h b/src/lib/server/request.h index 81860dc2945..82da7d84f2e 100644 --- a/src/lib/server/request.h +++ b/src/lib/server/request.h @@ -100,8 +100,8 @@ struct request_s { rad_listen_t *listener; //!< The listener that received the request. RADCLIENT *client; //!< The client that originally sent us the request. - RADIUS_PACKET *packet; //!< Incoming request. - RADIUS_PACKET *reply; //!< Outgoing response. + fr_radius_packet_t *packet; //!< Incoming request. + fr_radius_packet_t *reply; //!< Outgoing response. fr_pair_t *control; //!< #fr_pair_t (s) used to set per request parameters //!< for modules and the server core at runtime. diff --git a/src/lib/server/state.c b/src/lib/server/state.c index de6683a17d9..9e8971c5a59 100644 --- a/src/lib/server/state.c +++ b/src/lib/server/state.c @@ -289,7 +289,7 @@ static int _state_entry_free(fr_state_entry_t *entry) * @note Called with the mutex held. */ static fr_state_entry_t *state_entry_create(fr_state_tree_t *state, request_t *request, - RADIUS_PACKET *packet, fr_state_entry_t *old) + fr_radius_packet_t *packet, fr_state_entry_t *old) { size_t i; uint32_t x; diff --git a/src/lib/server/tcp.h b/src/lib/server/tcp.h index 26901a57dc4..f218da6b6fb 100644 --- a/src/lib/server/tcp.h +++ b/src/lib/server/tcp.h @@ -25,5 +25,5 @@ */ RCSIDH(tcp_h, "$Id$") -int fr_tcp_read_packet(RADIUS_PACKET *packet, uint32_t max_attributes, bool require_ma); -RADIUS_PACKET *fr_tcp_recv(int sockfd, int flags); +int fr_tcp_read_packet(fr_radius_packet_t *packet, uint32_t max_attributes, bool require_ma); +fr_radius_packet_t *fr_tcp_recv(int sockfd, int flags); diff --git a/src/lib/server/tmpl.h b/src/lib/server/tmpl.h index 01c4ba27b9f..92eed1f1210 100644 --- a/src/lib/server/tmpl.h +++ b/src/lib/server/tmpl.h @@ -836,7 +836,7 @@ void tmpl_debug(tmpl_t const *vpt); fr_pair_t **radius_list(request_t *request, pair_list_t list); -RADIUS_PACKET *radius_packet(request_t *request, pair_list_t list_name); +fr_radius_packet_t *radius_packet(request_t *request, pair_list_t list_name); TALLOC_CTX *radius_list_ctx(request_t *request, pair_list_t list_name); diff --git a/src/lib/server/tmpl_eval.c b/src/lib/server/tmpl_eval.c index a34528391bb..450ea1cc285 100644 --- a/src/lib/server/tmpl_eval.c +++ b/src/lib/server/tmpl_eval.c @@ -75,20 +75,20 @@ fr_pair_t **radius_list(request_t *request, pair_list_t list) return NULL; } -/** Resolve a list to the #RADIUS_PACKET holding the HEAD pointer for a #fr_pair_t list +/** Resolve a list to the #fr_radius_packet_t holding the HEAD pointer for a #fr_pair_t list * - * Returns a pointer to the #RADIUS_PACKET that holds the HEAD pointer of a given list, + * Returns a pointer to the #fr_radius_packet_t that holds the HEAD pointer of a given list, * for the current #request_t. * * @param[in] request To resolve list in. - * @param[in] list #pair_list_t value to resolve to #RADIUS_PACKET. + * @param[in] list #pair_list_t value to resolve to #fr_radius_packet_t. * @return - * - #RADIUS_PACKET on success. + * - #fr_radius_packet_t on success. * - NULL on failure. * * @see radius_list */ -RADIUS_PACKET *radius_packet(request_t *request, pair_list_t list) +fr_radius_packet_t *radius_packet(request_t *request, pair_list_t list) { switch (list) { /* Don't add default */ @@ -110,8 +110,8 @@ RADIUS_PACKET *radius_packet(request_t *request, pair_list_t list) /** Return the correct TALLOC_CTX to alloc #fr_pair_t in, for a list * * Allocating new #fr_pair_t in the context of a #request_t is usually wrong. - * #fr_pair_t should be allocated in the context of a #RADIUS_PACKET, so that if the - * #RADIUS_PACKET is freed before the #request_t, the associated #fr_pair_t lists are + * #fr_pair_t should be allocated in the context of a #fr_radius_packet_t, so that if the + * #fr_radius_packet_t is freed before the #request_t, the associated #fr_pair_t lists are * freed too. * * @param[in] request containing the target lists. diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index 8aecd68e056..6d3b6728f4d 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -409,7 +409,7 @@ static xlat_action_t xlat_eval_one_letter(TALLOC_CTX *ctx, fr_cursor_t *out, req */ static xlat_action_t xlat_eval_pair_virtual(TALLOC_CTX *ctx, fr_cursor_t *out, request_t *request, tmpl_t const *vpt) { - RADIUS_PACKET *packet = NULL; + fr_radius_packet_t *packet = NULL; fr_value_box_t *value; /* diff --git a/src/lib/util/packet.c b/src/lib/util/packet.c index 6e8262fd0f9..753a0d9dfdc 100644 --- a/src/lib/util/packet.c +++ b/src/lib/util/packet.c @@ -14,7 +14,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -/** RADIUS_PACKET alloc/free functions +/** fr_radius_packet_t alloc/free functions * * @file src/lib/util/packet.c * @@ -29,20 +29,20 @@ RCSID("$Id$") #include -/** Allocate a new RADIUS_PACKET +/** Allocate a new fr_radius_packet_t * * @param ctx the context in which the packet is allocated. May be NULL if * the packet is not associated with a request_t. * @param new_vector if true a new request authenticator will be generated. * @return - * - New RADIUS_PACKET. + * - New fr_radius_packet_t. * - NULL on error. */ -RADIUS_PACKET *fr_radius_alloc(TALLOC_CTX *ctx, bool new_vector) +fr_radius_packet_t *fr_radius_alloc(TALLOC_CTX *ctx, bool new_vector) { - RADIUS_PACKET *rp; + fr_radius_packet_t *rp; - rp = talloc_zero(ctx, RADIUS_PACKET); + rp = talloc_zero(ctx, fr_radius_packet_t); if (!rp) { fr_strerror_printf("out of memory"); return NULL; @@ -56,18 +56,18 @@ RADIUS_PACKET *fr_radius_alloc(TALLOC_CTX *ctx, bool new_vector) return rp; } -/** Allocate a new RADIUS_PACKET response +/** Allocate a new fr_radius_packet_t response * * @param ctx the context in which the packet is allocated. May be NULL if * the packet is not associated with a request_t. * @param packet The request packet. * @return - * - New RADIUS_PACKET. + * - New fr_radius_packet_t. * - NULL on error. */ -RADIUS_PACKET *fr_radius_alloc_reply(TALLOC_CTX *ctx, RADIUS_PACKET *packet) +fr_radius_packet_t *fr_radius_alloc_reply(TALLOC_CTX *ctx, fr_radius_packet_t *packet) { - RADIUS_PACKET *reply; + fr_radius_packet_t *reply; if (!packet) return NULL; @@ -90,12 +90,12 @@ RADIUS_PACKET *fr_radius_alloc_reply(TALLOC_CTX *ctx, RADIUS_PACKET *packet) } -/** Free a RADIUS_PACKET +/** Free a fr_radius_packet_t * */ -void fr_radius_packet_free(RADIUS_PACKET **packet_p) +void fr_radius_packet_free(fr_radius_packet_t **packet_p) { - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; if (!packet_p || !*packet_p) return; packet = *packet_p; diff --git a/src/lib/util/packet.h b/src/lib/util/packet.h index 40e4100b772..04b164439e6 100644 --- a/src/lib/util/packet.h +++ b/src/lib/util/packet.h @@ -37,7 +37,7 @@ extern "C" { #include #ifdef WITH_VERIFY_PTR -# define PACKET_VERIFY(_x) (void) talloc_get_type_abort_const(_x, RADIUS_PACKET) +# define PACKET_VERIFY(_x) (void) talloc_get_type_abort_const(_x, fr_radius_packet_t) #else # define PACKET_VERIFY(_x) fr_cond_assert(_x) #endif @@ -47,7 +47,7 @@ extern "C" { /* * vector: Request authenticator from access-request packet * Put in there by rad_decode, and must be put in the - * response RADIUS_PACKET as well before calling fr_radius_packet_send + * response fr_radius_packet_t as well before calling fr_radius_packet_send * * verified: Filled in by rad_decode for accounting-request packets * @@ -70,11 +70,11 @@ typedef struct { uint32_t rounds; //!< for State[0] size_t partial; -} RADIUS_PACKET; +} fr_radius_packet_t; -RADIUS_PACKET *fr_radius_alloc(TALLOC_CTX *ctx, bool new_vector); -RADIUS_PACKET *fr_radius_alloc_reply(TALLOC_CTX *ctx, RADIUS_PACKET *); -void fr_radius_packet_free(RADIUS_PACKET **); +fr_radius_packet_t *fr_radius_alloc(TALLOC_CTX *ctx, bool new_vector); +fr_radius_packet_t *fr_radius_alloc_reply(TALLOC_CTX *ctx, fr_radius_packet_t *); +void fr_radius_packet_free(fr_radius_packet_t **); #ifdef __cplusplus } diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 7e4bf7ca488..15250c62d16 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -102,7 +102,7 @@ fr_pair_t *fr_pair_alloc(TALLOC_CTX *ctx) * * @note Doesn't require qualification with a dictionary as fr_dict_attr_t are unique. * - * @param[in] ctx for allocated memory, usually a pointer to a #RADIUS_PACKET + * @param[in] ctx for allocated memory, usually a pointer to a #fr_radius_packet_t * @param[in] da Specifies the dictionary attribute to build the #fr_pair_t from. * @return * - A new #fr_pair_t. @@ -157,7 +157,7 @@ fr_pair_t *fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da) * Which type of #fr_dict_attr_t the #fr_pair_t was created with can be determined by * checking @verbatim vp->da->flags.is_unknown @endverbatim. * - * @param[in] ctx for allocated memory, usually a pointer to a #RADIUS_PACKET. + * @param[in] ctx for allocated memory, usually a pointer to a #fr_radius_packet_t. * @param[in] parent of the attribute being allocated (usually a dictionary or vendor). * @param[in] attr number. * @return diff --git a/src/lib/util/pair_legacy.c b/src/lib/util/pair_legacy.c index ff62dd7b368..b6bd5afc07e 100644 --- a/src/lib/util/pair_legacy.c +++ b/src/lib/util/pair_legacy.c @@ -47,7 +47,7 @@ RCSID("$Id$") * Which type of #fr_dict_attr_t the #fr_pair_t was created with can be determined by * checking @verbatim vp->da->flags.is_unknown @endverbatim. * - * @param[in] ctx for allocated memory, usually a pointer to a #RADIUS_PACKET. + * @param[in] ctx for allocated memory, usually a pointer to a #fr_radius_packet_t. * @param[in] attr number. * @param[in] vendor number. * @return diff --git a/src/modules/proto_bfd/proto_bfd.c b/src/modules/proto_bfd/proto_bfd.c index 7c16f0a60c6..7585a07f6c7 100644 --- a/src/modules/proto_bfd/proto_bfd.c +++ b/src/modules/proto_bfd/proto_bfd.c @@ -384,7 +384,7 @@ static const char *bfd_state[] = { }; -static void bfd_request(bfd_state_t *session, request_t *request, RADIUS_PACKET *packet) +static void bfd_request(bfd_state_t *session, request_t *request, fr_radius_packet_t *packet) { memset(request, 0, sizeof(*request)); memset(packet, 0, sizeof(*packet)); @@ -398,7 +398,7 @@ static void bfd_request(bfd_state_t *session, request_t *request, RADIUS_PACKET static void bfd_trigger(bfd_state_t *session) { - RADIUS_PACKET packet; + fr_radius_packet_t packet; request_t request; char buffer[256]; @@ -1324,7 +1324,7 @@ static int bfd_process(bfd_state_t *session, bfd_packet_t *bfd) * Warn about it. */ if ((session->detect_multi >= 2) && (session->last_recv > session->next_recv)) { - RADIUS_PACKET packet; + fr_radius_packet_t packet; request_t request; bfd_request(session, &request, &packet); @@ -1341,7 +1341,7 @@ static int bfd_process(bfd_state_t *session, bfd_packet_t *bfd) if (session->server_cs) { request_t *request; - RADIUS_PACKET *packet, *reply; + fr_radius_packet_t *packet, *reply; request = request_alloc(session); packet = fr_radius_alloc(request, 0); diff --git a/src/modules/proto_dhcpv4/dhcpclient.c b/src/modules/proto_dhcpv4/dhcpclient.c index edc168942a8..76dde800b11 100644 --- a/src/modules/proto_dhcpv4/dhcpclient.c +++ b/src/modules/proto_dhcpv4/dhcpclient.c @@ -141,13 +141,13 @@ static void NEVER_RETURNS usage(void) /* * Initialize the request. */ -static RADIUS_PACKET *request_init(char const *filename) +static fr_radius_packet_t *request_init(char const *filename) { FILE *fp; fr_cursor_t cursor; fr_pair_t *vp; bool filedone = false; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; /* * Determine where to read the VP's from. @@ -234,7 +234,7 @@ static RADIUS_PACKET *request_init(char const *filename) return packet; } -static void print_hex(RADIUS_PACKET *packet) +static void print_hex(fr_radius_packet_t *packet) { int i, j; uint8_t const *p, *a; @@ -298,15 +298,15 @@ static void print_hex(RADIUS_PACKET *packet) * We'll just return the first eligible reply, and display the others. */ #if defined(HAVE_LINUX_IF_PACKET_H) || defined (HAVE_LIBPCAP) -static RADIUS_PACKET *fr_dhcpv4_recv_raw_loop(int lsockfd, +static fr_radius_packet_t *fr_dhcpv4_recv_raw_loop(int lsockfd, #ifdef HAVE_LINUX_IF_PACKET_H struct sockaddr_ll *p_ll, #endif - RADIUS_PACKET *packet_p) + fr_radius_packet_t *packet_p) { fr_time_delta_t our_timeout; - RADIUS_PACKET *found = NULL; - RADIUS_PACKET *reply = NULL; + fr_radius_packet_t *found = NULL; + fr_radius_packet_t *reply = NULL; int nb_reply = 0; int nb_offer = 0; dc_offer_t *offer_list = NULL; @@ -405,7 +405,7 @@ static RADIUS_PACKET *fr_dhcpv4_recv_raw_loop(int lsockfd, } #endif /* or */ -static int send_with_socket(RADIUS_PACKET **reply, RADIUS_PACKET *packet) +static int send_with_socket(fr_radius_packet_t **reply, fr_radius_packet_t *packet) { int on = 1; @@ -486,7 +486,7 @@ static int send_with_socket(RADIUS_PACKET **reply, RADIUS_PACKET *packet) } #ifdef HAVE_LIBPCAP -static int send_with_pcap(RADIUS_PACKET **reply, RADIUS_PACKET *packet) +static int send_with_pcap(fr_radius_packet_t **reply, fr_radius_packet_t *packet) { char ip[16]; char pcap_filter[255]; @@ -537,7 +537,7 @@ static int send_with_pcap(RADIUS_PACKET **reply, RADIUS_PACKET *packet) } #endif /* HAVE_LIBPCAP */ -static void dhcp_packet_debug(RADIUS_PACKET *packet, bool received) +static void dhcp_packet_debug(fr_radius_packet_t *packet, bool received) { fr_cursor_t cursor; char buffer[2048]; @@ -607,8 +607,8 @@ int main(int argc, char **argv) char const *dict_dir = DICTDIR; char const *filename = NULL; - RADIUS_PACKET *packet = NULL; - RADIUS_PACKET *reply = NULL; + fr_radius_packet_t *packet = NULL; + fr_radius_packet_t *reply = NULL; TALLOC_CTX *autofree; diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4.c b/src/modules/proto_dhcpv4/proto_dhcpv4.c index 42dc0c61f3f..7096ef8a540 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4.c @@ -251,7 +251,7 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d fr_io_track_t const *track = talloc_get_type_abort_const(request->async->packet_ctx, fr_io_track_t); fr_io_address_t const *address = track->address; RADCLIENT const *client; - RADIUS_PACKET *packet = request->packet; + fr_radius_packet_t *packet = request->packet; fr_cursor_t cursor; /* diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_process.c b/src/modules/proto_dhcpv4/proto_dhcpv4_process.c index bbdacf19d5b..faf1a3368e6 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_process.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_process.c @@ -54,7 +54,7 @@ fr_dict_attr_autoload_t proto_dhcpv4_process_dict_attr[] = { /* * Debug the packet if requested. */ -static void dhcpv4_packet_debug(request_t *request, RADIUS_PACKET *packet, bool received) +static void dhcpv4_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { int i; #if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) diff --git a/src/modules/proto_dhcpv6/proto_dhcpv6.c b/src/modules/proto_dhcpv6/proto_dhcpv6.c index 0a7e5b888fa..e1e6167ea1f 100644 --- a/src/modules/proto_dhcpv6/proto_dhcpv6.c +++ b/src/modules/proto_dhcpv6/proto_dhcpv6.c @@ -253,7 +253,7 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d fr_io_track_t const *track = talloc_get_type_abort_const(request->async->packet_ctx, fr_io_track_t); fr_io_address_t const *address = track->address; RADCLIENT const *client; - RADIUS_PACKET *packet = request->packet; + fr_radius_packet_t *packet = request->packet; fr_cursor_t cursor; /* diff --git a/src/modules/proto_dhcpv6/proto_dhcpv6_process.c b/src/modules/proto_dhcpv6/proto_dhcpv6_process.c index ae4cc441c7c..80b70699c97 100644 --- a/src/modules/proto_dhcpv6/proto_dhcpv6_process.c +++ b/src/modules/proto_dhcpv6/proto_dhcpv6_process.c @@ -51,7 +51,7 @@ fr_dict_attr_autoload_t proto_dhcpv6_process_dict_attr[] = { /* * Debug the packet if requested. */ -static void dhcpv6_packet_debug(request_t *request, RADIUS_PACKET *packet, bool received) +static void dhcpv6_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { #if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) char if_name[IFNAMSIZ]; diff --git a/src/modules/proto_ldap_sync/proto_ldap_sync.c b/src/modules/proto_ldap_sync/proto_ldap_sync.c index 9e84b234958..5bc152e037f 100644 --- a/src/modules/proto_ldap_sync/proto_ldap_sync.c +++ b/src/modules/proto_ldap_sync/proto_ldap_sync.c @@ -228,7 +228,7 @@ fr_dict_attr_autoload_t proto_ldap_sync_dict_attr[] = { { NULL } }; -static request_t *request_setup(UNUSED TALLOC_CTX *ctx, UNUSED rad_listen_t *listener, UNUSED RADIUS_PACKET *packet, +static request_t *request_setup(UNUSED TALLOC_CTX *ctx, UNUSED rad_listen_t *listener, UNUSED fr_radius_packet_t *packet, UNUSED RADCLIENT *client, UNUSED RAD_REQUEST_FUNP fun) { fr_assert(0 == 1); @@ -300,7 +300,7 @@ static int proto_ldap_socket_print(rad_listen_t const *listen, char *buffer, siz * @param[in] packet containing attributes from the entry we received. * @param[in] received Should always be true. */ -static void proto_ldap_packet_debug(request_t *request, RADIUS_PACKET *packet, bool received) +static void proto_ldap_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { if (!packet) return; if (!RDEBUG_ENABLED) return; @@ -495,7 +495,7 @@ static void request_queued(request_t *request, fr_state_signal_t action) static request_t *proto_ldap_request_setup(rad_listen_t *listen, proto_ldap_inst_t *inst, int sync_id) { TALLOC_CTX *ctx; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; request_t *request; ctx = talloc_pool(NULL, main_config->talloc_pool_size); diff --git a/src/modules/proto_vmps/proto_vmps.c b/src/modules/proto_vmps/proto_vmps.c index 7dad847ea06..23063035ba9 100644 --- a/src/modules/proto_vmps/proto_vmps.c +++ b/src/modules/proto_vmps/proto_vmps.c @@ -228,7 +228,7 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d fr_io_track_t const *track = talloc_get_type_abort_const(request->async->packet_ctx, fr_io_track_t); fr_io_address_t const *address = track->address; RADCLIENT const *client; - RADIUS_PACKET *packet = request->packet; + fr_radius_packet_t *packet = request->packet; fr_cursor_t cursor; fr_assert(data[0] < FR_RADIUS_MAX_PACKET_CODE); diff --git a/src/modules/rlm_attr_filter/rlm_attr_filter.c b/src/modules/rlm_attr_filter/rlm_attr_filter.c index 1996e2aab06..cda5bcc704a 100644 --- a/src/modules/rlm_attr_filter/rlm_attr_filter.c +++ b/src/modules/rlm_attr_filter/rlm_attr_filter.c @@ -169,7 +169,7 @@ static int mod_instantiate(void *instance, UNUSED CONF_SECTION *conf) * Common attr_filter checks */ static rlm_rcode_t CC_HINT(nonnull(1,2)) attr_filter_common(void const *instance, request_t *request, - RADIUS_PACKET *packet) + fr_radius_packet_t *packet) { rlm_attr_filter_t const *inst = talloc_get_type_abort_const(instance, rlm_attr_filter_t); fr_pair_t *vp; diff --git a/src/modules/rlm_detail/rlm_detail.c b/src/modules/rlm_detail/rlm_detail.c index a275778c576..dc07563ee5f 100644 --- a/src/modules/rlm_detail/rlm_detail.c +++ b/src/modules/rlm_detail/rlm_detail.c @@ -246,7 +246,7 @@ static void detail_fr_pair_fprint(TALLOC_CTX *ctx, FILE *out, fr_pair_t const *s * @param[in] packet associated with the request (request, reply...). * @param[in] compat Write out entry in compatibility mode. */ -static int detail_write(FILE *out, rlm_detail_t const *inst, request_t *request, RADIUS_PACKET *packet, bool compat) +static int detail_write(FILE *out, rlm_detail_t const *inst, request_t *request, fr_radius_packet_t *packet, bool compat) { fr_pair_t *vp; char timestamp[256]; @@ -368,7 +368,7 @@ static int detail_write(FILE *out, rlm_detail_t const *inst, request_t *request, * Do detail, compatible with old accounting */ static rlm_rcode_t CC_HINT(nonnull) detail_do(void const *instance, request_t *request, - RADIUS_PACKET *packet, bool compat) + fr_radius_packet_t *packet, bool compat) { int outfd, dupfd; char buffer[DIRLEN]; diff --git a/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c b/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c index 4649a0c9853..ff0abcc0ec7 100644 --- a/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c +++ b/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c @@ -474,7 +474,7 @@ ssize_t eap_fast_decode_pair(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dict_attr_ */ static rlm_rcode_t CC_HINT(nonnull) process_reply(UNUSED eap_session_t *eap_session, fr_tls_session_t *tls_session, - request_t *request, RADIUS_PACKET *reply) + request_t *request, fr_radius_packet_t *reply) { rlm_rcode_t rcode = RLM_MODULE_REJECT; fr_pair_t *vp; diff --git a/src/modules/rlm_eap/types/rlm_eap_peap/peap.c b/src/modules/rlm_eap/types/rlm_eap_peap/peap.c index 4ee25bdfa14..1353fb8a902 100644 --- a/src/modules/rlm_eap/types/rlm_eap_peap/peap.c +++ b/src/modules/rlm_eap/types/rlm_eap_peap/peap.c @@ -153,7 +153,7 @@ static int eap_peap_soh(request_t *request,fr_tls_session_t *tls_session) return 1; } -static void eap_peap_soh_verify(request_t *request, RADIUS_PACKET *packet, +static void eap_peap_soh_verify(request_t *request, fr_radius_packet_t *packet, uint8_t const *data, unsigned int data_len) { fr_pair_t *vp; @@ -260,7 +260,7 @@ static int eap_peap_verify(request_t *request, peap_tunnel_t *peap_tunnel, /* * Convert a pseudo-EAP packet to a list of fr_pair_t's. */ -static fr_pair_t *eap_peap_inner_to_pairs(UNUSED request_t *request, RADIUS_PACKET *packet, +static fr_pair_t *eap_peap_inner_to_pairs(UNUSED request_t *request, fr_radius_packet_t *packet, eap_round_t *eap_round, uint8_t const *data, size_t data_len) { @@ -367,7 +367,7 @@ static int eap_peap_check_tlv(request_t *request, uint8_t const *data, size_t da * Use a reply packet to determine what to do. */ static rlm_rcode_t CC_HINT(nonnull) process_reply(eap_session_t *eap_session, fr_tls_session_t *tls_session, - request_t *request, RADIUS_PACKET *reply) + request_t *request, fr_radius_packet_t *reply) { rlm_rcode_t rcode = RLM_MODULE_REJECT; fr_pair_t *vp; diff --git a/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c b/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c index b5427a68308..de04aef6cba 100644 --- a/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c +++ b/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c @@ -464,7 +464,7 @@ static int vp2diameter(request_t *request, fr_tls_session_t *tls_session, fr_pai * Use a reply packet to determine what to do. */ static rlm_rcode_t CC_HINT(nonnull) process_reply(NDEBUG_UNUSED eap_session_t *eap_session, fr_tls_session_t *tls_session, - request_t *request, RADIUS_PACKET *reply) + request_t *request, fr_radius_packet_t *reply) { rlm_rcode_t rcode = RLM_MODULE_REJECT; fr_pair_t *vp, *tunnel_vps = NULL; diff --git a/src/modules/rlm_files/rlm_files.c b/src/modules/rlm_files/rlm_files.c index 45c0c898f36..b14cec3083d 100644 --- a/src/modules/rlm_files/rlm_files.c +++ b/src/modules/rlm_files/rlm_files.c @@ -292,7 +292,7 @@ static int mod_instantiate(void *instance, UNUSED CONF_SECTION *conf) * Common code called by everything below. */ static rlm_rcode_t file_common(rlm_files_t const *inst, request_t *request, char const *filename, rbtree_t *tree, - RADIUS_PACKET *packet, RADIUS_PACKET *reply) + fr_radius_packet_t *packet, fr_radius_packet_t *reply) { char const *name; fr_pair_t *check_tmp = NULL; diff --git a/src/modules/rlm_sometimes/rlm_sometimes.c b/src/modules/rlm_sometimes/rlm_sometimes.c index f0215d49f96..373cff70392 100644 --- a/src/modules/rlm_sometimes/rlm_sometimes.c +++ b/src/modules/rlm_sometimes/rlm_sometimes.c @@ -69,7 +69,7 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) /* * A lie! It always returns! */ -static rlm_rcode_t sometimes_return(void const *instance, request_t *request, RADIUS_PACKET *packet, RADIUS_PACKET *reply) +static rlm_rcode_t sometimes_return(void const *instance, request_t *request, fr_radius_packet_t *packet, fr_radius_packet_t *reply) { uint32_t hash; rlm_sometimes_t const *inst = talloc_get_type_abort_const(instance, rlm_sometimes_t); diff --git a/src/protocols/dhcpv4/base.c b/src/protocols/dhcpv4/base.c index 22fbd6f9265..197c947d871 100644 --- a/src/protocols/dhcpv4/base.c +++ b/src/protocols/dhcpv4/base.c @@ -202,7 +202,7 @@ int8_t fr_dhcpv4_attr_cmp(void const *a, void const *b) return fr_pair_cmp_by_parent_num(my_a, my_b); } -/** Check received DHCP request is valid and build RADIUS_PACKET structure if it is +/** Check received DHCP request is valid and build fr_radius_packet_t structure if it is * * @param data pointer to received packet. * @param data_len length of received data, and then length of the actual DHCP data. diff --git a/src/protocols/dhcpv4/dhcpv4.h b/src/protocols/dhcpv4/dhcpv4.h index ee87d14dab1..5035521d028 100644 --- a/src/protocols/dhcpv4/dhcpv4.h +++ b/src/protocols/dhcpv4/dhcpv4.h @@ -145,7 +145,7 @@ typedef struct { int8_t fr_dhcpv4_attr_cmp(void const *a, void const *b); bool fr_dhcpv4_ok(uint8_t const *data, ssize_t data_len, uint8_t *message_type, uint32_t *xid); -RADIUS_PACKET *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len); +fr_radius_packet_t *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len); bool fr_dhcpv4_is_encodable(void *item, UNUSED void *uctx); ssize_t fr_dhcpv4_encode(uint8_t *buffer, size_t buflen, dhcp_packet_t *original, int code, uint32_t xid, fr_pair_t *vps); ssize_t fr_dhcpv4_encode_dbuff(fr_dbuff_t *dbuff, dhcp_packet_t *original, int code, uint32_t xid, fr_pair_t *vps); @@ -171,7 +171,7 @@ uint8_t const *fr_dhcpv4_packet_get_option(dhcp_packet_t const *packet, size_t p int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_cursor_t *cursor, unsigned int *code); -int fr_dhcpv4_packet_encode(RADIUS_PACKET *packet); +int fr_dhcpv4_packet_encode(fr_radius_packet_t *packet); #ifdef HAVE_LINUX_IF_PACKET_H /* @@ -180,9 +180,9 @@ int fr_dhcpv4_packet_encode(RADIUS_PACKET *packet); #include int fr_dhcpv4_raw_socket_open(struct sockaddr_ll *p_ll, int iface_index); -int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *p_ll, RADIUS_PACKET *packet); +int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *p_ll, fr_radius_packet_t *packet); -RADIUS_PACKET *fr_dhcv4_raw_packet_recv(int sockfd, struct sockaddr_ll *p_ll, RADIUS_PACKET *request); +fr_radius_packet_t *fr_dhcv4_raw_packet_recv(int sockfd, struct sockaddr_ll *p_ll, fr_radius_packet_t *request); #endif /* @@ -192,16 +192,16 @@ RADIUS_PACKET *fr_dhcv4_raw_packet_recv(int sockfd, struct sockaddr_ll *p_ll, RA /* * Use fr_pcap_init and fr_pcap_open to create/open handles. */ -RADIUS_PACKET *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap); +fr_radius_packet_t *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap); -int fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, RADIUS_PACKET *packet); +int fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, fr_radius_packet_t *packet); #endif /* * udp.c */ -RADIUS_PACKET *fr_dhcpv4_udp_packet_recv(int sockfd); -int fr_dhcpv4_udp_packet_send(RADIUS_PACKET *packet); +fr_radius_packet_t *fr_dhcpv4_udp_packet_recv(int sockfd); +int fr_dhcpv4_udp_packet_send(fr_radius_packet_t *packet); #ifdef __cplusplus } diff --git a/src/protocols/dhcpv4/packet.c b/src/protocols/dhcpv4/packet.c index 081e339ef9d..5f884a717b2 100644 --- a/src/protocols/dhcpv4/packet.c +++ b/src/protocols/dhcpv4/packet.c @@ -382,7 +382,7 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, uint8_t const *data, size_t data_len, fr_c return 0; } -int fr_dhcpv4_packet_encode(RADIUS_PACKET *packet) +int fr_dhcpv4_packet_encode(fr_radius_packet_t *packet) { ssize_t len; fr_pair_t *vp; @@ -410,9 +410,9 @@ int fr_dhcpv4_packet_encode(RADIUS_PACKET *packet) return 0; } -RADIUS_PACKET *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len) +fr_radius_packet_t *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len) { - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; uint32_t magic; uint8_t const *code; diff --git a/src/protocols/dhcpv4/pcap.c b/src/protocols/dhcpv4/pcap.c index 82b051876f3..ad514a2abdd 100644 --- a/src/protocols/dhcpv4/pcap.c +++ b/src/protocols/dhcpv4/pcap.c @@ -37,7 +37,7 @@ * - -1 on failure. * - 0 on success. */ -int fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, RADIUS_PACKET *packet) +int fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, fr_radius_packet_t *packet) { int ret; uint8_t dhcp_packet[1518] = { 0 }; @@ -107,10 +107,10 @@ int fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, RADIUS_PACKET * * @param pcap handle * @return - * - pointer to RADIUS_PACKET if successful. + * - pointer to fr_radius_packet_t if successful. * - NULL if failed. */ -RADIUS_PACKET *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap) +fr_radius_packet_t *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap) { int ret; @@ -120,7 +120,7 @@ RADIUS_PACKET *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap) uint16_t src_port, dst_port; struct pcap_pkthdr *header; ssize_t link_len, len; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; /* * Pointers into the packet data we just received diff --git a/src/protocols/dhcpv4/raw.c b/src/protocols/dhcpv4/raw.c index fc52295ea96..c82e406e562 100644 --- a/src/protocols/dhcpv4/raw.c +++ b/src/protocols/dhcpv4/raw.c @@ -104,7 +104,7 @@ int fr_dhcpv4_raw_socket_open(struct sockaddr_ll *link_layer, int ifindex) * - 0 on success. * - -1 on failure. */ -int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *link_layer, RADIUS_PACKET *packet) +int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *link_layer, fr_radius_packet_t *packet) { uint8_t dhcp_packet[1518] = { 0 }; ethernet_header_t *eth_hdr = (ethernet_header_t *)dhcp_packet; @@ -171,10 +171,10 @@ int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *link_layer, RADIUS * * FIXME: split this into two, recv_raw_packet, and verify(packet, original) */ -RADIUS_PACKET *fr_dhcv4_raw_packet_recv(int sockfd, struct sockaddr_ll *link_layer, RADIUS_PACKET *request) +fr_radius_packet_t *fr_dhcv4_raw_packet_recv(int sockfd, struct sockaddr_ll *link_layer, fr_radius_packet_t *request) { fr_pair_t *vp; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; uint8_t const *code; uint32_t magic, xid; ssize_t data_len; diff --git a/src/protocols/dhcpv4/udp.c b/src/protocols/dhcpv4/udp.c index e6954c4b7f4..3b9cc51b69f 100644 --- a/src/protocols/dhcpv4/udp.c +++ b/src/protocols/dhcpv4/udp.c @@ -51,7 +51,7 @@ * - >= 0 if successful. * - < 0 if failed. */ -int fr_dhcpv4_udp_packet_send(RADIUS_PACKET *packet) +int fr_dhcpv4_udp_packet_send(fr_radius_packet_t *packet) { int ret; struct sockaddr_storage dst; @@ -79,16 +79,16 @@ int fr_dhcpv4_udp_packet_send(RADIUS_PACKET *packet) * * @param sockfd handle. * @return - * - pointer to RADIUS_PACKET if successful. + * - pointer to fr_radius_packet_t if successful. * - NULL if failed. */ -RADIUS_PACKET *fr_dhcpv4_udp_packet_recv(int sockfd) +fr_radius_packet_t *fr_dhcpv4_udp_packet_recv(int sockfd) { struct sockaddr_storage src; struct sockaddr_storage dst; socklen_t sizeof_src; socklen_t sizeof_dst; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; uint8_t *data; ssize_t data_len; fr_ipaddr_t src_ipaddr, dst_ipaddr; diff --git a/src/protocols/radius/encode.c b/src/protocols/radius/encode.c index caf0000c79d..fab7b85e13c 100644 --- a/src/protocols/radius/encode.c +++ b/src/protocols/radius/encode.c @@ -57,7 +57,7 @@ static ssize_t encode_tlv_hdr(fr_dbuff_t *dbuff, * @param[in] password_len Length of input password. */ void fr_radius_encode_chap_password(uint8_t out[static 1 + RADIUS_CHAP_CHALLENGE_LENGTH], - RADIUS_PACKET *packet, uint8_t id, char const *password, size_t password_len) + fr_radius_packet_t *packet, uint8_t id, char const *password, size_t password_len) { fr_pair_t *challenge; fr_md5_ctx_t *md5_ctx; diff --git a/src/protocols/radius/list.c b/src/protocols/radius/list.c index 883391388ad..6e1421d970a 100644 --- a/src/protocols/radius/list.c +++ b/src/protocols/radius/list.c @@ -39,7 +39,7 @@ RCSID("$Id$") * That's because if the authentication vector is different, * it means that the NAS has given up on the earlier request. */ -int fr_packet_cmp(RADIUS_PACKET const *a, RADIUS_PACKET const *b) +int fr_packet_cmp(fr_radius_packet_t const *a, fr_radius_packet_t const *b) { int rcode; @@ -85,8 +85,8 @@ int fr_packet_cmp(RADIUS_PACKET const *a, RADIUS_PACKET const *b) /* * Create a fake "request" from a reply, for later lookup. */ -void fr_request_from_reply(RADIUS_PACKET *request, - RADIUS_PACKET const *reply) +void fr_request_from_reply(fr_radius_packet_t *request, + fr_radius_packet_t const *reply) { fr_socket_addr_swap(&request->socket, &reply->socket); request->id = reply->id; @@ -279,8 +279,8 @@ bool fr_packet_list_socket_add(fr_packet_list_t *pl, int sockfd, int proto, static int packet_entry_cmp(void const *one, void const *two) { - RADIUS_PACKET const * const *a = one; - RADIUS_PACKET const * const *b = two; + fr_radius_packet_t const * const *a = one; + fr_radius_packet_t const * const *b = two; return fr_packet_cmp(*a, *b); } @@ -325,14 +325,14 @@ fr_packet_list_t *fr_packet_list_create(int alloc_id) * be called before inserting the packet into the list! */ bool fr_packet_list_insert(fr_packet_list_t *pl, - RADIUS_PACKET **request_p) + fr_radius_packet_t **request_p) { if (!pl || !request_p || !*request_p) return 0; return rbtree_insert(pl->tree, request_p); } -RADIUS_PACKET **fr_packet_list_find(fr_packet_list_t *pl, RADIUS_PACKET *request) +fr_radius_packet_t **fr_packet_list_find(fr_packet_list_t *pl, fr_radius_packet_t *request) { if (!pl || !request) return 0; @@ -344,9 +344,9 @@ RADIUS_PACKET **fr_packet_list_find(fr_packet_list_t *pl, RADIUS_PACKET *request * This presumes that the reply has dst_ipaddr && dst_port set up * correctly (i.e. real IP, or "*"). */ -RADIUS_PACKET **fr_packet_list_find_byreply(fr_packet_list_t *pl, RADIUS_PACKET *reply) +fr_radius_packet_t **fr_packet_list_find_byreply(fr_packet_list_t *pl, fr_radius_packet_t *reply) { - RADIUS_PACKET my_request, *request; + fr_radius_packet_t my_request, *request; fr_packet_socket_t *ps; if (!pl || !reply) return NULL; @@ -382,7 +382,7 @@ RADIUS_PACKET **fr_packet_list_find_byreply(fr_packet_list_t *pl, RADIUS_PACKET } -bool fr_packet_list_yank(fr_packet_list_t *pl, RADIUS_PACKET *request) +bool fr_packet_list_yank(fr_packet_list_t *pl, fr_radius_packet_t *request) { rbnode_t *node; @@ -423,12 +423,12 @@ uint32_t fr_packet_list_num_elements(fr_packet_list_t *pl) * should be used. */ bool fr_packet_list_id_alloc(fr_packet_list_t *pl, int proto, - RADIUS_PACKET **request_p, void **pctx) + fr_radius_packet_t **request_p, void **pctx) { int i, j, k, fd, id, start_i, start_j, start_k; int src_any = 0; fr_packet_socket_t *ps= NULL; - RADIUS_PACKET *request = *request_p; + fr_radius_packet_t *request = *request_p; if ((request->socket.inet.dst_ipaddr.af == AF_UNSPEC) || (request->socket.inet.dst_port == 0)) { @@ -647,7 +647,7 @@ bool fr_packet_list_id_alloc(fr_packet_list_t *pl, int proto, * any newly inserted entries don't collide with this one. */ bool fr_packet_list_id_free(fr_packet_list_t *pl, - RADIUS_PACKET *request, bool yank) + fr_radius_packet_t *request, bool yank) { fr_packet_socket_t *ps; @@ -711,10 +711,10 @@ int fr_packet_list_fd_set(fr_packet_list_t *pl, fd_set *set) * FIXME: Add socket.fd, if -1, do round-robin, else do socket.fd * IF in fdset. */ -RADIUS_PACKET *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma) +fr_radius_packet_t *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma) { int start; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; if (!pl || !set) return NULL; @@ -769,7 +769,7 @@ uint32_t fr_packet_list_num_outgoing(fr_packet_list_t *pl) /* * Debug the packet if requested. */ -void fr_packet_header_log(fr_log_t const *log, RADIUS_PACKET *packet, bool received) +void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool received) { char src_ipaddr[FR_IPADDR_STRLEN]; char dst_ipaddr[FR_IPADDR_STRLEN]; @@ -840,7 +840,7 @@ void fr_packet_header_log(fr_log_t const *log, RADIUS_PACKET *packet, bool recei /* * Debug the packet header and all attributes */ -void fr_packet_log(fr_log_t const *log, RADIUS_PACKET *packet, bool received) +void fr_packet_log(fr_log_t const *log, fr_radius_packet_t *packet, bool received) { fr_packet_header_log(log, packet, received); if (fr_debug_lvl >= L_DBG_LVL_1) fr_pair_list_log(log, packet->vps); diff --git a/src/protocols/radius/list.h b/src/protocols/radius/list.h index 346d91c88b9..58baf23d6b6 100644 --- a/src/protocols/radius/list.h +++ b/src/protocols/radius/list.h @@ -29,28 +29,28 @@ RCSIDH(list_h, "$Id$") #include #include -int fr_packet_cmp(RADIUS_PACKET const *a, RADIUS_PACKET const *b); -void fr_request_from_reply(RADIUS_PACKET *request, - RADIUS_PACKET const *reply); +int fr_packet_cmp(fr_radius_packet_t const *a, fr_radius_packet_t const *b); +void fr_request_from_reply(fr_radius_packet_t *request, + fr_radius_packet_t const *reply); typedef struct fr_packet_list_s fr_packet_list_t; fr_packet_list_t *fr_packet_list_create(int alloc_id); void fr_packet_list_free(fr_packet_list_t *pl); bool fr_packet_list_insert(fr_packet_list_t *pl, - RADIUS_PACKET **request_p); + fr_radius_packet_t **request_p); -RADIUS_PACKET **fr_packet_list_find(fr_packet_list_t *pl, - RADIUS_PACKET *request); -RADIUS_PACKET **fr_packet_list_find_byreply(fr_packet_list_t *pl, - RADIUS_PACKET *reply); +fr_radius_packet_t **fr_packet_list_find(fr_packet_list_t *pl, + fr_radius_packet_t *request); +fr_radius_packet_t **fr_packet_list_find_byreply(fr_packet_list_t *pl, + fr_radius_packet_t *reply); bool fr_packet_list_yank(fr_packet_list_t *pl, - RADIUS_PACKET *request); + fr_radius_packet_t *request); uint32_t fr_packet_list_num_elements(fr_packet_list_t *pl); bool fr_packet_list_id_alloc(fr_packet_list_t *pl, int proto, - RADIUS_PACKET **request_p, void **pctx); + fr_radius_packet_t **request_p, void **pctx); bool fr_packet_list_id_free(fr_packet_list_t *pl, - RADIUS_PACKET *request, bool yank); + fr_radius_packet_t *request, bool yank); bool fr_packet_list_socket_add(fr_packet_list_t *pl, int sockfd, int proto, fr_ipaddr_t *dst_ipaddr, uint16_t dst_port, void *ctx); @@ -59,15 +59,15 @@ bool fr_packet_list_socket_freeze(fr_packet_list_t *pl, int sockfd); bool fr_packet_list_socket_thaw(fr_packet_list_t *pl, int sockfd); int fr_packet_list_walk(fr_packet_list_t *pl, rb_walker_t callback, void *uctx); int fr_packet_list_fd_set(fr_packet_list_t *pl, fd_set *set); -RADIUS_PACKET *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma); +fr_radius_packet_t *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma); uint32_t fr_packet_list_num_incoming(fr_packet_list_t *pl); uint32_t fr_packet_list_num_outgoing(fr_packet_list_t *pl); -void fr_packet_header_log(fr_log_t const *log, RADIUS_PACKET *packet, bool received); -void fr_packet_log(fr_log_t const *log, RADIUS_PACKET *packet, bool received); +void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool received); +void fr_packet_log(fr_log_t const *log, fr_radius_packet_t *packet, bool received); /* - * "find" returns a pointer to the RADIUS_PACKET* member in the + * "find" returns a pointer to the fr_radius_packet_t* member in the * caller's structure. In order to get the pointer to the *top* * of the caller's structure, you have to subtract the offset to * the member from the returned pointer, and cast it to the diff --git a/src/protocols/radius/packet.c b/src/protocols/radius/packet.c index 7f08a36481e..545bbf8f4ea 100644 --- a/src/protocols/radius/packet.c +++ b/src/protocols/radius/packet.c @@ -18,7 +18,7 @@ * $Id$ * * @file protocols/radius/packet.c - * @brief Functions to deal with RADIUS_PACKET data structures. + * @brief Functions to deal with fr_radius_packet_t data structures. * * @copyright 2000-2017 The FreeRADIUS server project */ @@ -54,7 +54,7 @@ typedef struct { /** Encode a packet * */ -ssize_t fr_radius_packet_encode(RADIUS_PACKET *packet, RADIUS_PACKET const *original, char const *secret) +ssize_t fr_radius_packet_encode(fr_radius_packet_t *packet, fr_radius_packet_t const *original, char const *secret) { uint8_t const *original_data; ssize_t slen; @@ -110,7 +110,7 @@ ssize_t fr_radius_packet_encode(RADIUS_PACKET *packet, RADIUS_PACKET const *orig * - 0 on success * - -1 on decoding error. */ -int fr_radius_packet_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original, +int fr_radius_packet_decode(fr_radius_packet_t *packet, fr_radius_packet_t *original, uint32_t max_attributes, bool tunnel_password_zeros, char const *secret) { int packet_length; @@ -256,7 +256,7 @@ int fr_radius_packet_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original, * - True on success. * - False on failure. */ -bool fr_radius_packet_ok(RADIUS_PACKET *packet, uint32_t max_attributes, bool require_ma, decode_fail_t *reason) +bool fr_radius_packet_ok(fr_radius_packet_t *packet, uint32_t max_attributes, bool require_ma, decode_fail_t *reason) { char host_ipaddr[INET6_ADDRSTRLEN]; @@ -280,7 +280,7 @@ bool fr_radius_packet_ok(RADIUS_PACKET *packet, uint32_t max_attributes, bool re /** Verify the Request/Response Authenticator (and Message-Authenticator if present) of a packet * */ -int fr_radius_packet_verify(RADIUS_PACKET *packet, RADIUS_PACKET *original, char const *secret) +int fr_radius_packet_verify(fr_radius_packet_t *packet, fr_radius_packet_t *original, char const *secret) { uint8_t const *original_data; char buffer[INET6_ADDRSTRLEN]; @@ -308,7 +308,7 @@ int fr_radius_packet_verify(RADIUS_PACKET *packet, RADIUS_PACKET *original, char /** Sign a previously encoded packet * */ -int fr_radius_packet_sign(RADIUS_PACKET *packet, RADIUS_PACKET const *original, +int fr_radius_packet_sign(fr_radius_packet_t *packet, fr_radius_packet_t const *original, char const *secret) { int rcode; @@ -342,7 +342,7 @@ int fr_radius_packet_sign(RADIUS_PACKET *packet, RADIUS_PACKET const *original, /** Wrapper for recvfrom, which handles recvfromto, IPv6, and all possible combinations * */ -static ssize_t rad_recvfrom(int sockfd, RADIUS_PACKET *packet, int flags) +static ssize_t rad_recvfrom(int sockfd, fr_radius_packet_t *packet, int flags) { ssize_t data_len; @@ -366,13 +366,13 @@ static ssize_t rad_recvfrom(int sockfd, RADIUS_PACKET *packet, int flags) } -/** Receive UDP client requests, and fill in the basics of a RADIUS_PACKET structure +/** Receive UDP client requests, and fill in the basics of a fr_radius_packet_t structure * */ -RADIUS_PACKET *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, uint32_t max_attributes, bool require_ma) +fr_radius_packet_t *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, uint32_t max_attributes, bool require_ma) { ssize_t data_len; - RADIUS_PACKET *packet; + fr_radius_packet_t *packet; /* * Allocate the new request data structure @@ -460,7 +460,7 @@ RADIUS_PACKET *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, uint32_ * * Also attach reply attribute value pairs and any user message provided. */ -int fr_radius_packet_send(RADIUS_PACKET *packet, RADIUS_PACKET const *original, +int fr_radius_packet_send(fr_radius_packet_t *packet, fr_radius_packet_t const *original, char const *secret) { /* @@ -519,7 +519,7 @@ int fr_radius_packet_send(RADIUS_PACKET *packet, RADIUS_PACKET const *original, &packet->socket.inet.dst_ipaddr, packet->socket.inet.dst_port); } -void _fr_radius_packet_log_hex(fr_log_t const *log, RADIUS_PACKET const *packet, char const *file, int line) +void _fr_radius_packet_log_hex(fr_log_t const *log, fr_radius_packet_t const *packet, char const *file, int line) { uint8_t const *attr, *end; char buffer[256]; diff --git a/src/protocols/radius/radius.h b/src/protocols/radius/radius.h index fc1cbb1d3ff..b1f9a3f85b5 100644 --- a/src/protocols/radius/radius.h +++ b/src/protocols/radius/radius.h @@ -142,26 +142,26 @@ void fr_radius_free(void); /* * protocols/radius/packet.c */ -ssize_t fr_radius_packet_encode(RADIUS_PACKET *packet, RADIUS_PACKET const *original, +ssize_t fr_radius_packet_encode(fr_radius_packet_t *packet, fr_radius_packet_t const *original, char const *secret) CC_HINT(nonnull (1,3)); -int fr_radius_packet_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original, +int fr_radius_packet_decode(fr_radius_packet_t *packet, fr_radius_packet_t *original, uint32_t max_attributes, bool tunnel_password_zeros, char const *secret) CC_HINT(nonnull (1,5)); -bool fr_radius_packet_ok(RADIUS_PACKET *packet, uint32_t max_attributes, bool require_ma, +bool fr_radius_packet_ok(fr_radius_packet_t *packet, uint32_t max_attributes, bool require_ma, decode_fail_t *reason) CC_HINT(nonnull (1)); -int fr_radius_packet_verify(RADIUS_PACKET *packet, RADIUS_PACKET *original, +int fr_radius_packet_verify(fr_radius_packet_t *packet, fr_radius_packet_t *original, char const *secret) CC_HINT(nonnull (1,3)); -int fr_radius_packet_sign(RADIUS_PACKET *packet, RADIUS_PACKET const *original, +int fr_radius_packet_sign(fr_radius_packet_t *packet, fr_radius_packet_t const *original, char const *secret) CC_HINT(nonnull (1,3)); -RADIUS_PACKET *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, uint32_t max_attributes, bool require_ma); -int fr_radius_packet_send(RADIUS_PACKET *packet, RADIUS_PACKET const *original, +fr_radius_packet_t *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, uint32_t max_attributes, bool require_ma); +int fr_radius_packet_send(fr_radius_packet_t *packet, fr_radius_packet_t const *original, char const *secret) CC_HINT(nonnull (1,3)); #define fr_radius_packet_log_hex(_log, _packet) _fr_radius_packet_log_hex(_log, _packet, __FILE__, __LINE__); -void _fr_radius_packet_log_hex(fr_log_t const *log, RADIUS_PACKET const *packet, char const *file, int line) CC_HINT(nonnull); +void _fr_radius_packet_log_hex(fr_log_t const *log, fr_radius_packet_t const *packet, char const *file, int line) CC_HINT(nonnull); typedef struct { fr_pair_t *parent; @@ -191,7 +191,7 @@ ssize_t fr_radius_decode_abinary(fr_pair_t *vp, uint8_t const *data, size_t dat * protocols/radius/encode.c */ void fr_radius_encode_chap_password(uint8_t out[static 1 + RADIUS_CHAP_CHALLENGE_LENGTH], - RADIUS_PACKET *packet, uint8_t id, + fr_radius_packet_t *packet, uint8_t id, char const *password, size_t password_len) CC_HINT(nonnull(1,2,4)); ssize_t fr_radius_encode_pair(fr_dbuff_t *dbuff, fr_cursor_t *cursor, void *encoder_ctx); diff --git a/src/protocols/radius/tcp.c b/src/protocols/radius/tcp.c index eb71af500f4..76b1aea025c 100644 --- a/src/protocols/radius/tcp.c +++ b/src/protocols/radius/tcp.c @@ -28,9 +28,9 @@ RCSID("$Id$") #include #include -RADIUS_PACKET *fr_tcp_recv(int sockfd, int flags) +fr_radius_packet_t *fr_tcp_recv(int sockfd, int flags) { - RADIUS_PACKET *packet = fr_radius_alloc(NULL, false); + fr_radius_packet_t *packet = fr_radius_alloc(NULL, false); if (!packet) return NULL; @@ -45,7 +45,7 @@ RADIUS_PACKET *fr_tcp_recv(int sockfd, int flags) } /* - * Receives a packet, assuming that the RADIUS_PACKET structure + * Receives a packet, assuming that the fr_radius_packet_t structure * has been filled out already. * * This ASSUMES that the packet is allocated && fields @@ -57,7 +57,7 @@ RADIUS_PACKET *fr_tcp_recv(int sockfd, int flags) * Calling this function MAY change sockfd, * if src_ipaddr.af == AF_UNSPEC. */ -int fr_tcp_read_packet(RADIUS_PACKET *packet, uint32_t max_attributes, bool require_ma) +int fr_tcp_read_packet(fr_radius_packet_t *packet, uint32_t max_attributes, bool require_ma) { ssize_t len;