]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
s/RADIUS_PACKET/fr_radius_packet_t/
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 3 Nov 2020 22:03:38 +0000 (16:03 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 3 Nov 2020 22:03:38 +0000 (16:03 -0600)
53 files changed:
src/bin/radclient.c
src/bin/radclient.h
src/bin/radsniff.c
src/bin/radsniff.h
src/bin/radsnmp.c
src/bin/unit_test_module.c
src/lib/eap/base.c
src/lib/eap/base.h
src/lib/eap/chbind.c
src/lib/eap/chbind.h
src/lib/server/auth.c
src/lib/server/listen.h
src/lib/server/main_config.c
src/lib/server/protocol.c
src/lib/server/protocol.h
src/lib/server/request.c
src/lib/server/request.h
src/lib/server/state.c
src/lib/server/tcp.h
src/lib/server/tmpl.h
src/lib/server/tmpl_eval.c
src/lib/unlang/xlat_eval.c
src/lib/util/packet.c
src/lib/util/packet.h
src/lib/util/pair.c
src/lib/util/pair_legacy.c
src/modules/proto_bfd/proto_bfd.c
src/modules/proto_dhcpv4/dhcpclient.c
src/modules/proto_dhcpv4/proto_dhcpv4.c
src/modules/proto_dhcpv4/proto_dhcpv4_process.c
src/modules/proto_dhcpv6/proto_dhcpv6.c
src/modules/proto_dhcpv6/proto_dhcpv6_process.c
src/modules/proto_ldap_sync/proto_ldap_sync.c
src/modules/proto_vmps/proto_vmps.c
src/modules/rlm_attr_filter/rlm_attr_filter.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c
src/modules/rlm_eap/types/rlm_eap_peap/peap.c
src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_sometimes/rlm_sometimes.c
src/protocols/dhcpv4/base.c
src/protocols/dhcpv4/dhcpv4.h
src/protocols/dhcpv4/packet.c
src/protocols/dhcpv4/pcap.c
src/protocols/dhcpv4/raw.c
src/protocols/dhcpv4/udp.c
src/protocols/radius/encode.c
src/protocols/radius/list.c
src/protocols/radius/list.h
src/protocols/radius/packet.c
src/protocols/radius/radius.h
src/protocols/radius/tcp.c

index 672bf60a95b71d91585f2fdceb42ebb5ff004b66..76c05f98c92b5030483d3a45a1e2137b0cf6a6b7 100644 (file)
@@ -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 */
index a27e38da39f1b0876ce693b8f08874fa7624661f..25173b10190d999b5df45dcddede4238c46838cb 100644 (file)
@@ -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.
 
index e29fb9e761f21e1c2f0b0e6c1abc713d832997b9..95ca25913f60780af4870cbacbcdec240be9656a 100644 (file)
@@ -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;
index 08d478a133e31f6323f8b498ed45d40627027de9..9348b084814fdaab3363a09cf98b73ad37f3cf38 100644 (file)
@@ -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.
 
 
index 89f5e9ab314727313a45fb90580e85274113a3f9..a6265bf25a6b280e2ab9d798384bd15e6f3ad5fb 100644 (file)
@@ -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;
index b40526876c3912b255a8f5dfaf7a2f136d3a8f8c..bf2c7c2b32bd28d8d38ee30a81f3cc031cbfcca0 100644 (file)
@@ -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;
index 5b279337cc2402282b814caf5aa7d60af016fbd1..9a4ae4a7cc48818dbe54b9228815a7ed4ffb5d7d 100644 (file)
@@ -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;
index fc8d8ba6afa354c22c9b0d8023a9e97f77905546..fd6744f60276a350ed32d54c034f3e9aad5790d4 100644 (file)
@@ -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);
 
index 4549966934528b521402f19e93d4b26c5cd2ce20..ed933f480816ffdec12e480ee87f9f98f6c61b65 100644 (file)
@@ -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;
 
index 3362c38c5138d85d9b9da329e50ecbd4b76daaeb..933c606f7d40856d2976ac723216bd35d3c9b921 100644 (file)
@@ -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);
index 9cc187fb2817f6e5477d6e8b6e756f1fbb5c3575..666c5a88fd2c8210f8482c44fb48545ace86f150 100644 (file)
@@ -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];
index 0de5bb0c29465d39615a112c9197a5ad1296b11f..7d315ba818e6ad4dec6828ecf66dc93c450f7cd4 100644 (file)
@@ -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;
index 577d3abd86e28e6b14280879ea58e09c4fcf56b6..19ca35a6db2d5c60f6cf488327ddb8e764f07f4b 100644 (file)
@@ -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.
         */
index d4162e8e0bf0e394af90e5b4958e8c4dcbaa0863..db415f122939740a01e772c910b7bf589a1b27a8 100644 (file)
@@ -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];
index 68a2112a1ca99bc17113f29f40f61e3a33353138..3900828012cc71c43d6b5536de6ec1542e9a139f 100644 (file)
@@ -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
  *
index d23955b53992a146c8fbdcf206cec162174a252e..8e7252981acda5e6230b85d6b503bc00c854ee43 100644 (file)
@@ -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");
index 81860dc29458d765ecf504cef20094e5e84cb9a2..82da7d84f2e1a548556355f6df78a25f0a4e2f69 100644 (file)
@@ -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.
index de6683a17d920be209dc56274b9165a4c4b4895c..9e8971c5a5979f62341e1210d21aa1dc86e202b3 100644 (file)
@@ -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;
index 26901a57dc441f196fea876725cfc280dc0b6927..f218da6b6fb4ef970e3da0405bdfae0b295f06d9 100644 (file)
@@ -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);
index 01c4ba27b9fbdea08d09e20a9c20a076c08d9134..92eed1f1210c6feb283fca1844f5704ea9ac73d9 100644 (file)
@@ -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);
 
index a34528391bbd2d672ce8b880dfbd448bd826c965..450ea1cc285deb64387841bab4010772464a6036 100644 (file)
@@ -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.
index 8aecd68e056749245946baf952b443fc10644cf1..6d3b6728f4dbf68d4a279cfd47f617f95b5c5efa 100644 (file)
@@ -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;
 
        /*
index 6e8262fd0f99733c76f640087dcb17a9625ada9e..753a0d9dfdcc1bc5333d73929e1d7872a6dd397c 100644 (file)
@@ -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 <talloc.h>
 
-/** 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;
index 40e4100b772c81635211d33ecd25c29ed78c63a0..04b164439e62350e2429a58e384a22c6e4cb7ab9 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
 #include <freeradius-devel/util/time.h>
 
 #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
 }
index 7e4bf7ca4883ff9c41b1864e5d37d65a2de61d39..15250c62d16810a58fa790c6d83a1e11b67c144d 100644 (file)
@@ -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
index ff62dd7b3681b998a5e3e3ef9fe1b62d2d5aecf3..b6bd5afc07ec8d5206156d4f93bd80498b871c9f 100644 (file)
@@ -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
index 7c16f0a60c6c46a65b6dad88f9adf2faee8e54ee..7585a07f6c7c6f4f131a9574c2c599c625120256 100644 (file)
@@ -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);
index edc168942a8e462bccb5ca286ae628c1671d686e..76dde800b117fc2f0705001b962154541ba53b68 100644 (file)
@@ -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 /* <if/packet.h> or <pcap.h> */
 
-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;
 
index 42dc0c61f3f9346fd287465735057844797d5730..7096ef8a5401ce08067439afb13089ab98293eed 100644 (file)
@@ -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;
 
        /*
index bbdacf19d5b34cd5e16353d031b733a14a23b817..faf1a3368e6e9a6bcf1243f232bbe2845196b586 100644 (file)
@@ -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)
index 0a7e5b888fad0ae0caffc2b89e380a6e57b5c855..e1e6167ea1ff7b64911d0313650bbcea3bee6213 100644 (file)
@@ -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;
 
        /*
index ae4cc441c7c1eb35115d3a14fdad27d255f969c4..80b70699c973e286a327b95785f8337226884808 100644 (file)
@@ -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];
index 9e84b234958f1b3ab575d79121aeeb53fc4042cc..5bc152e037f4440dceee7fea7c5e62c1076d8d1b 100644 (file)
@@ -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);
index 7dad847ea0669142853b27fe5794436cd4c1def3..23063035ba9051599e1195c50995b314cc6a80ef 100644 (file)
@@ -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);
index 1996e2aab06d7c7be5157f27aa4941680a086fb9..cda5bcc704a49f1ef91f81019b42f665d4bbe04c 100644 (file)
@@ -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;
index a275778c57699385da6330c510a7c77c0e9ff170..dc07563ee5f2d8a09703d520efe027349140eac7 100644 (file)
@@ -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];
index 4649a0c9853fa0a4be51680e05cd94d3d01a1282..ff0abcc0ec71eaa64e6e66b322ff22b2e0d0bae7 100644 (file)
@@ -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;
index 4ee25bdfa144b39e29ab21934ef9e24b6152308b..1353fb8a902646c0c1ecd58d1bab04afa4a0cfb0 100644 (file)
@@ -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;
index b5427a68308e6b40a264594f529e6a7acc5f48c7..de04aef6cba3ce17c3d552927a833c07b8fd5393 100644 (file)
@@ -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;
index 45c0c898f367d481dbf7f41d83532961a8087136..b14cec3083d76d0ea1f2a240f0d79292a7d6a078 100644 (file)
@@ -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;
index f0215d49f962f7ee5ffef63c82b389bfffcf494b..373cff703928ff0d7f22d032580ba4b788ebf33d 100644 (file)
@@ -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);
index 22fbd6f9265c6a50fda2a0a4889e777f2f8a68ec..197c947d871eef02366d55df4857d2f54b6aee73 100644 (file)
@@ -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.
index ee87d14dab1842c2bda36da68501d0dc7b738771..5035521d028e7f6f2734eaa5840675d2e440d2bd 100644 (file)
@@ -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 <linux/if_packet.h>
 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
 }
index 081e339ef9d568c7d267fcb81e3ab0e640d7cc38..5f884a717b2cfd92cd82fc9ba8c2b6f9fec1b678 100644 (file)
@@ -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;
 
index 82b051876f338c73f916e496f29bfadca465f38a..ad514a2abdd2927657ab30e1476d2967d65cd1f6 100644 (file)
@@ -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
index fc52295ea96dc5ed2e9237644a174ee3376d9644..c82e406e562a4e8751ce23752dd5098de55e1a94 100644 (file)
@@ -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;
index e6954c4b7f4c4ec4b15b80f0a3dd6cf93658fe9c..3b9cc51b69fbb78a29163dcf99cdc4622b043a2d 100644 (file)
@@ -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;
index caf0000c79d6c30053bfac5dda052887b31c2888..fab7b85e13c8db5c21244c425cf47d37c8a088ae 100644 (file)
@@ -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;
index 883391388ad682e643136081fbee636633bc8af1..6e1421d970a255f98579dfb5b51f211796f5873b 100644 (file)
@@ -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);
index 346d91c88b9e024b772f4c87a0283689f1f2e712..58baf23d6b602c5d02647e83548483afccf1baae 100644 (file)
@@ -29,28 +29,28 @@ RCSIDH(list_h, "$Id$")
 #include <stdbool.h>
 #include <stdint.h>
 
-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
index 7f08a36481ef5100eb098099d5c840b42ae8f2e0..545bbf8f4ea46e91c2dcb42ee9eea39e85b85b6d 100644 (file)
@@ -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];
index fc1cbb1d3ff9486e70726b25d8b0ddaa02bc732f..b1f9a3f85b5fa2884c07cf9ec1825300343e9f34 100644 (file)
@@ -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);
index eb71af500f44c8efead0c5842571b6c56702e18a..76b1aea025c06c6ec5640f11a023993b6bfecebc 100644 (file)
@@ -28,9 +28,9 @@ RCSID("$Id$")
 #include <freeradius-devel/radius/radius.h>
 #include <freeradius-devel/server/tcp.h>
 
-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;