]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
s/fr_radius_packet_t/fr_packet_t/g
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 6 Mar 2024 20:10:48 +0000 (14:10 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 6 Mar 2024 20:10:56 +0000 (14:10 -0600)
59 files changed:
src/bin/dhcpclient.c
src/bin/radclient-ng.c
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/bio/packet.h
src/lib/server/auth.c
src/lib/server/listen.h
src/lib/server/main_config.c
src/lib/server/packet.c
src/lib/server/packet.h
src/lib/server/protocol.c
src/lib/server/protocol.h
src/lib/server/request.c
src/lib/server/request.h
src/lib/server/tmpl.h
src/lib/server/tmpl_eval.c
src/lib/util/packet.c
src/lib/util/packet.h
src/lib/util/pair.c
src/listen/dhcpv4/proto_dhcpv4.c
src/listen/dhcpv6/proto_dhcpv6.c
src/listen/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_sometimes/rlm_sometimes.c
src/process/arp/base.c
src/process/bfd/base.c
src/process/dhcpv4/base.c
src/process/dhcpv6/base.c
src/process/dns/base.c
src/process/ldap_sync/base.c
src/process/radius/base.c
src/process/ttls/base.c
src/process/vmps/base.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/client.c
src/protocols/radius/client_priv.h
src/protocols/radius/client_tcp.c
src/protocols/radius/client_udp.c
src/protocols/radius/id.c
src/protocols/radius/id.h
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
src/protocols/radius/tcp.h

index 109afe8d165f230cfde77faa45036a30c262ef93..67708e855331ff3eadeda9f6615a6d718f71c6e3 100644 (file)
@@ -133,12 +133,12 @@ static NEVER_RETURNS void usage(void)
 /*
  *     Initialize the request.
  */
-static int request_init(fr_radius_packet_t **out, fr_pair_list_t *packet_vps, char const *filename)
+static int request_init(fr_packet_t **out, fr_pair_list_t *packet_vps, char const *filename)
 {
        FILE                    *fp;
        fr_pair_t               *vp;
        bool                    filedone = false;
-       fr_radius_packet_t      *packet;
+       fr_packet_t     *packet;
 
        /*
         *      Determine where to read the VP's from.
@@ -214,11 +214,11 @@ static int request_init(fr_radius_packet_t **out, fr_pair_list_t *packet_vps, ch
  *     We'll just return the first eligible reply, and display the others.
  */
 #if defined(HAVE_LINUX_IF_PACKET_H) || defined (HAVE_LIBPCAP)
-static fr_radius_packet_t *fr_dhcpv4_recv_raw_loop(int lsockfd,
+static fr_packet_t *fr_dhcpv4_recv_raw_loop(int lsockfd,
 #ifdef HAVE_LINUX_IF_PACKET_H
                                            struct sockaddr_ll *p_ll,
 #endif
-                                           fr_radius_packet_t *request,
+                                           fr_packet_t *request,
 #ifndef HAVE_LINUX_IF_PACKET_H
                                            UNUSED
 #endif
@@ -226,8 +226,8 @@ static fr_radius_packet_t *fr_dhcpv4_recv_raw_loop(int lsockfd,
                                            )
 {
        fr_time_delta_t our_timeout;
-       fr_radius_packet_t      *found = NULL;
-       fr_radius_packet_t      *reply = NULL;
+       fr_packet_t     *found = NULL;
+       fr_packet_t     *reply = NULL;
        fr_pair_list_t          reply_vps;
        int                     nb_reply = 0;
        int                     nb_offer = 0;
@@ -326,7 +326,7 @@ static fr_radius_packet_t *fr_dhcpv4_recv_raw_loop(int lsockfd,
 }
 #endif /* <if/packet.h> or <pcap.h> */
 
-static int send_with_socket(fr_radius_packet_t **reply, fr_radius_packet_t *request,
+static int send_with_socket(fr_packet_t **reply, fr_packet_t *request,
 #ifndef HAVE_LINUX_IF_PACKET_H
                            UNUSED
 #endif
@@ -411,7 +411,7 @@ static int send_with_socket(fr_radius_packet_t **reply, fr_radius_packet_t *requ
 }
 
 #ifdef HAVE_LIBPCAP
-static int send_with_pcap(fr_radius_packet_t **reply, fr_radius_packet_t *request, fr_pair_list_t *request_list)
+static int send_with_pcap(fr_packet_t **reply, fr_packet_t *request, fr_pair_list_t *request_list)
 {
        char ip[16];
        char pcap_filter[255];
@@ -462,7 +462,7 @@ static int send_with_pcap(fr_radius_packet_t **reply, fr_radius_packet_t *reques
 }
 #endif /* HAVE_LIBPCAP */
 
-static void dhcp_packet_debug(fr_radius_packet_t *packet, fr_pair_list_t *list, bool received)
+static void dhcp_packet_debug(fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
        char            buffer[2048];
 
@@ -531,9 +531,9 @@ int main(int argc, char **argv)
        char const              *dict_dir = DICTDIR;
        char const              *filename = NULL;
 
-       fr_radius_packet_t      *packet = NULL;
+       fr_packet_t     *packet = NULL;
        fr_pair_list_t          packet_vps;
-       fr_radius_packet_t      *reply = NULL;
+       fr_packet_t     *reply = NULL;
        fr_pair_list_t          reply_vps;
 
        int                     ret;
index d697c728d119e2613a8cfad33c340aa0aadb4f03..93b147c97314909e8605b2910a588625e56480a4 100644 (file)
@@ -224,7 +224,7 @@ static void openssl3_free(void)
 #define openssl3_free()
 #endif
 
-static int mschapv1_encode(fr_radius_packet_t *packet, fr_pair_list_t *list,
+static int mschapv1_encode(fr_packet_t *packet, fr_pair_list_t *list,
                           char const *password)
 {
        unsigned int            i;
@@ -916,7 +916,7 @@ static int recv_one_packet(fr_time_delta_t wait_time)
        fd_set                  set;
        fr_time_delta_t         our_wait_time;
        rc_request_t            *request;
-       fr_radius_packet_t      *reply, *packet;
+       fr_packet_t     *reply, *packet;
        volatile int            max_fd;
 
 #ifdef STATIC_ANALYZER
index 627570032231e35c5d275efcd08e0a941e5947e5..a44a82a653054eb9cf37d76c852d34a684f6800e 100644 (file)
@@ -241,7 +241,7 @@ static void openssl3_free(void)
 #define openssl3_free()
 #endif
 
-static int mschapv1_encode(fr_radius_packet_t *packet, fr_pair_list_t *list,
+static int mschapv1_encode(fr_packet_t *packet, fr_pair_list_t *list,
                           char const *password)
 {
        unsigned int            i;
@@ -1131,7 +1131,7 @@ static int recv_coa_packet(fr_time_delta_t wait_time)
        fd_set                  set;
        fr_time_delta_t         our_wait_time;
        rc_request_t            *request, *parent;
-       fr_radius_packet_t      *packet;
+       fr_packet_t     *packet;
 
 #ifdef STATIC_ANALYZER
        if (!secret) fr_exit_now(1);
@@ -1270,7 +1270,7 @@ static int recv_one_packet(fr_time_delta_t wait_time)
        fd_set                  set;
        fr_time_delta_t         our_wait_time;
        rc_request_t            *request;
-       fr_radius_packet_t      *reply, *packet;
+       fr_packet_t     *reply, *packet;
        volatile int            max_fd;
 
 #ifdef STATIC_ANALYZER
index 4f30a418e795f6e1b12e20bcdc801054289ee9c8..e163f780e1ff80a8c78a656abde2207992b45530 100644 (file)
@@ -85,8 +85,8 @@ struct rc_request {
        fr_pair_t               *password;      //!< Password.Cleartext
        fr_time_t               timestamp;
 
-       fr_radius_packet_t      *packet;        //!< The outgoing request.
-       fr_radius_packet_t      *reply;         //!< The incoming response.
+       fr_packet_t     *packet;        //!< The outgoing request.
+       fr_packet_t     *reply;         //!< The incoming response.
 
        fr_pair_list_t          request_pairs;
        fr_pair_list_t          reply_pairs;
index 20d279db7546ec72f8492365df6e4ce8e2a21376..a01b63995eafbff0f092b1fb1548c104188b58a3 100644 (file)
@@ -308,7 +308,7 @@ static void rs_packet_print_csv_header(void)
 }
 
 static void rs_packet_print_csv(uint64_t count, rs_status_t status, fr_pcap_t *handle,
-                               fr_radius_packet_t *packet, fr_pair_list_t *list,
+                               fr_packet_t *packet, fr_pair_list_t *list,
                                UNUSED struct timeval *elapsed, struct timeval *latency, UNUSED bool response,
                                bool body)
 {
@@ -382,7 +382,7 @@ static void rs_packet_print_csv(uint64_t count, rs_status_t status, fr_pcap_t *h
 }
 
 static void rs_packet_print_fancy(uint64_t count, rs_status_t status, fr_pcap_t *handle,
-                                 fr_radius_packet_t *packet, fr_pair_list_t *list,
+                                 fr_packet_t *packet, fr_pair_list_t *list,
                                  struct timeval *elapsed, struct timeval *latency, bool response, bool body)
 {
        char buffer[2048];
@@ -477,7 +477,7 @@ static void rs_packet_print_fancy(uint64_t count, rs_status_t status, fr_pcap_t
 }
 
 static void rs_packet_save_in_output_dir(uint64_t count, UNUSED rs_status_t status, UNUSED fr_pcap_t *handle,
-                                 fr_radius_packet_t *packet, fr_pair_list_t *list,
+                                 fr_packet_t *packet, fr_pair_list_t *list,
                                  UNUSED struct timeval *elapsed, UNUSED struct timeval *latency, bool response, bool body)
 {
        fr_log_t output_file;
@@ -528,7 +528,7 @@ static void rs_packet_save_in_output_dir(uint64_t count, UNUSED rs_status_t stat
 }
 
 static inline void rs_packet_print(rs_request_t *request, uint64_t count, rs_status_t status, fr_pcap_t *handle,
-                                  fr_radius_packet_t *packet, fr_pair_list_t *list,
+                                  fr_packet_t *packet, fr_pair_list_t *list,
                                   struct timeval *elapsed, struct timeval *latency,
                                   bool response, bool body)
 {
@@ -1283,7 +1283,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) */
-       fr_radius_packet_t      *packet;                /* Current packet were processing */
+       fr_packet_t     *packet;                /* Current packet were processing */
        rs_request_t            *original = NULL;
        fr_pair_list_t          decoded;
 
@@ -1886,7 +1886,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
         */
        } else if (!conf->filter_response && (conf->event_flags & status)) {
                uint64_t                print_id;
-               fr_radius_packet_t      *print_packet;
+               fr_packet_t     *print_packet;
                fr_pair_list_t          *print_pair_list;
 
                if (original) {
index c810b77176c8acdee7e16a4787f25b8bb8b493c4..10c2de3c134cbcb676f0c24bcb98032b29ee09e7 100644 (file)
@@ -76,7 +76,7 @@ typedef enum {
 } rs_status_t;
 
 typedef void (*rs_packet_logger_t)(uint64_t count, rs_status_t status, fr_pcap_t *handle,
-                                  fr_radius_packet_t *packet, fr_pair_list_t *list,
+                                  fr_packet_t *packet, fr_pair_list_t *list,
                                   struct timeval *elapsed, struct timeval *latency, bool response, bool body);
 typedef enum {
 #ifdef HAVE_COLLECTDC_H
@@ -176,7 +176,7 @@ typedef struct {
        uint8_t                 *data;                  //!< PCAP packet data.
 } rs_capture_t;
 
-/** Wrapper for fr_radius_packet_t
+/** Wrapper for fr_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.
@@ -190,11 +190,11 @@ 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.
-       fr_radius_packet_t      *packet;                //!< The original packet.
+       fr_packet_t     *packet;                //!< The original packet.
        fr_pair_list_t          packet_vps;
-       fr_radius_packet_t      *expect;                //!< Request/response.
+       fr_packet_t     *expect;                //!< Request/response.
        fr_pair_list_t          expect_vps;
-       fr_radius_packet_t      *linked;                //!< The subsequent response or forwarded request the packet
+       fr_packet_t     *linked;                //!< The subsequent response or forwarded request the packet
                                                        //!< was linked against.
        fr_pair_list_t          link_vps;               //!< fr_pair_ts used to link retransmissions.
 
index cc127f03e5b2a308d60c4a2081724bac4a2faca8..a6736f10cf124ed7cba6b00d33ccc9f6084fff07 100644 (file)
@@ -162,9 +162,9 @@ static void rs_signal_stop(UNUSED int sig)
  * @param fd the request will be sent on.
  * @return new request.
  */
-static fr_radius_packet_t *radsnmp_alloc(radsnmp_conf_t *conf, int fd)
+static fr_packet_t *radsnmp_alloc(radsnmp_conf_t *conf, int fd)
 {
-       fr_radius_packet_t *packet;
+       fr_packet_t *packet;
 
        packet = fr_radius_packet_alloc(conf, true);
 
@@ -654,7 +654,7 @@ do { \
 
                fr_dcursor_t            cursor;
                fr_pair_t               *vp;
-               fr_radius_packet_t      *packet;
+               fr_packet_t     *packet;
                fr_pair_list_t          request_vps;
 
                /*
@@ -773,7 +773,7 @@ do { \
                 *      Send the packet
                 */
                {
-                       fr_radius_packet_t      *reply = NULL;
+                       fr_packet_t     *reply = NULL;
                        fr_pair_list_t          reply_vps;
                        ssize_t                 rcode;
 
index d0afcd6f39f35a4c48199c9dbb6ace4a85daa126..759e0d272ffbfee8ba12443a348200e5c1929dd3 100644 (file)
@@ -364,7 +364,7 @@ static request_t *request_from_file(TALLOC_CTX *ctx, FILE *fp, fr_client_t *clie
 }
 
 
-static void print_packet(FILE *fp, fr_radius_packet_t *packet, fr_pair_list_t *list)
+static void print_packet(FILE *fp, fr_packet_t *packet, fr_pair_list_t *list)
 {
        fr_dict_enum_value_t *dv;
        fr_log_t log;
index b3ee6b0f2bae160332674e1bf2f9e4d0067f0946..361d89d7ac3d3f6af205ce710966d0fc2af8856e 100644 (file)
@@ -18,7 +18,7 @@
 /**
  * $Id$
  * @file lib/bio/packet.h
- * @brief Binary IO abstractions for #fr_radius_packet_t
+ * @brief Binary IO abstractions for #fr_packet_t
  *
  * @copyright 2024 Network RADIUS SAS (legal@networkradius.com)
  */
@@ -42,7 +42,7 @@ typedef struct fr_bio_packet_s fr_bio_packet_t;
  *     - <0 on error
  *     - 0 for success (*packet_p may still be NULL tho)
  */
-typedef int (*fr_bio_packet_read_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t **packet_p, TALLOC_CTX *ctx, fr_pair_list_t *out);
+typedef int (*fr_bio_packet_read_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t **packet_p, TALLOC_CTX *ctx, fr_pair_list_t *out);
 
 /** Write a packet and pairs from the network
  *
@@ -54,7 +54,7 @@ typedef int (*fr_bio_packet_read_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_r
  *     - <0 on error (EOF, fail, etc,)
  *     - 0 for success
  */
-typedef int (*fr_bio_packet_write_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t *packet, fr_pair_list_t *list);
+typedef int (*fr_bio_packet_write_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t *packet, fr_pair_list_t *list);
 
 /** Release an outgoing packet.
  *
@@ -65,7 +65,7 @@ typedef int (*fr_bio_packet_write_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_
  *     - <0 on error
  *     - 0 for success
  */
-typedef int (*fr_bio_packet_release_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t *packet);
+typedef int (*fr_bio_packet_release_t)(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t *packet);
 
 struct fr_bio_packet_s {
        void                    *uctx;          //!< user ctx, caller can manually set it.
@@ -79,17 +79,17 @@ struct fr_bio_packet_s {
 };
 
 
-static inline CC_HINT(nonnull) int fr_bio_packet_read(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t **packet_p, TALLOC_CTX *ctx, fr_pair_list_t *out)
+static inline CC_HINT(nonnull) int fr_bio_packet_read(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t **packet_p, TALLOC_CTX *ctx, fr_pair_list_t *out)
 {
        return bio->read(bio, packet_ctx, packet_p, ctx, out);
 }
 
-static inline CC_HINT(nonnull) int fr_bio_packet_write(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t *packet, fr_pair_list_t *list)
+static inline CC_HINT(nonnull) int fr_bio_packet_write(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t *packet, fr_pair_list_t *list)
 {
        return bio->write(bio, packet_ctx, packet, list);
 }
 
-static inline CC_HINT(nonnull) int fr_bio_packet_release(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t *packet)
+static inline CC_HINT(nonnull) int fr_bio_packet_release(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t *packet)
 {
        if (!bio->release) return 0;
 
index 4a5c48eb18fbb2f1ca9ee03b47bff7c72d64682c..25ed29b8f5dde15c42efa35fda966d7f7912f4a6 100644 (file)
@@ -196,7 +196,7 @@ unlang_action_t rad_virtual_server(rlm_rcode_t *p_result, request_t *request)
 /*
  *     Debug the packet if requested.
  */
-void common_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_pair_list_t *pairs, bool received)
+void common_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *pairs, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index 95e1b9a33ed0342d340d370dcc4208c76fb368d7..c3f60b1c0f9dae95bf38c0b619ecfe418fc2ffc7 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 *, fr_radius_packet_t *, fr_pair_list_t *, bool received);
+typedef void (*rad_listen_debug_t)(request_t *, fr_packet_t *, fr_pair_list_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 *);
 
index 5805a3cfc4a70cdc9e1d4fc4251b3fc8b281b6dc..a887227053edefcfdf0bed684d54a9f6aaf190f9 100644 (file)
@@ -1068,7 +1068,7 @@ int main_config_init(main_config_t *config)
        INFO("Starting - reading configuration files ...");
 
        /*
-        *      About sizeof(request_t) + sizeof(fr_radius_packet_t) * 2 + sizeof(fr_pair_t) * 400
+        *      About sizeof(request_t) + sizeof(fr_packet_t) * 2 + sizeof(fr_pair_t) * 400
         *
         *      Which should be enough for many configurations.
         */
index 5d7f50345ae919cf03260094e538739cfd2fdc2d..2882adc211306f4b45c705eac0f54f2331a68eb7 100644 (file)
@@ -14,7 +14,7 @@
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-/** fr_radius_packet_t alloc/free functions
+/** fr_packet_t alloc/free functions
  *
  * @file src/lib/server/packet.c
  *
@@ -76,14 +76,14 @@ static int inet2pairs(TALLOC_CTX *ctx, fr_pair_list_t *list,
 /** Allocate a "Net." struct with src/dst host and port.
  *
  * @param      ctx    The context in which the packet is allocated.
- * @param[in]  list   #fr_pair_list_t value to resolve to #fr_radius_packet_t.
+ * @param[in]  list   #fr_pair_list_t value to resolve to #fr_packet_t.
  * @param[out] packet The request packet.
  *
  * @return
  *     -  0 on success
  *     - <0 on error.
  */
-int fr_packet_pairs_from_packet(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_radius_packet_t const *packet)
+int fr_packet_pairs_from_packet(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_packet_t const *packet)
 {
        fr_pair_t *vp, *net, *tlv;
 
@@ -103,7 +103,7 @@ int fr_packet_pairs_from_packet(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_radius
         *      Net.Dst
         */
        if (fr_pair_find_or_append_by_da(net, &tlv, &net->vp_group, attr_net_dst) < 0) return -1;
-       
+
        if (inet2pairs(tlv, &tlv->vp_group, attr_net_dst_ip, attr_net_dst_port, &packet->socket.inet.dst_ipaddr, packet->socket.inet.dst_port) < 0) return -1;
 
        /*
@@ -123,7 +123,7 @@ static void pairs2inet(fr_ipaddr_t *ipaddr, uint16_t *port, fr_pair_list_t const
 
        vp = fr_pair_find_by_da(list, NULL, attr_ip);
        if (vp) *ipaddr = vp->vp_ip;
-       
+
        vp = fr_pair_find_by_da(list, NULL, attr_port);
        if (vp) *port = vp->vp_uint16;
 }
@@ -133,7 +133,7 @@ static void pairs2inet(fr_ipaddr_t *ipaddr, uint16_t *port, fr_pair_list_t const
  * @param packet       the packet to send
  * @param list         the list to check for Net.*
  */
-void fr_packet_pairs_to_packet(fr_radius_packet_t *packet, fr_pair_list_t const *list)
+void fr_packet_pairs_to_packet(fr_packet_t *packet, fr_pair_list_t const *list)
 {
        fr_pair_t *net, *tlv;
 
index 586314913d5e1d2e66886d90b90a7a2e654dec89..50bd51c5228e98a238e6b83705505d45ad80421b 100644 (file)
@@ -30,8 +30,8 @@ extern "C" {
 #include <freeradius-devel/util/packet.h>
 #include <freeradius-devel/util/socket.h>
 
-int fr_packet_pairs_from_packet(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_radius_packet_t const *packet) CC_HINT(nonnull);
-void fr_packet_pairs_to_packet(fr_radius_packet_t *packet, fr_pair_list_t const *list) CC_HINT(nonnull);
+int fr_packet_pairs_from_packet(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_packet_t const *packet) CC_HINT(nonnull);
+void fr_packet_pairs_to_packet(fr_packet_t *packet, fr_pair_list_t const *list) CC_HINT(nonnull);
 
 int packet_global_init(void);
 void packet_global_free(void);
index e61df3b5ac3a9080ce324e7262ad72e9f455838e..3fd4b0bb6f2073207110cdfaa30615258ca50443 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
 /*
  *     Debug the packet if requested.
  */
-void common_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_pair_list_t *pairs, bool received)
+void common_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *pairs, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index be56ed47fae79481af4434779271dcfc5fe8ca16..6550c11a88b99d138689f1461e1b28bd7864779e 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, fr_radius_packet_t *packet, fr_pair_list_t *pairs, bool received);
+void common_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *pairs, bool received);
 
 /** Struct exported by a proto_* module
  *
index 795c8b6f0b25e0973652faabfb9728cfca3efd06..0dd20048c154a164c82d7ee6c369568be4e0d4cf 100644 (file)
@@ -472,7 +472,7 @@ static inline CC_HINT(always_inline) request_t *request_alloc_pool(TALLOC_CTX *c
                                           10,                                  /* extra */
                                           (UNLANG_FRAME_PRE_ALLOC * UNLANG_STACK_MAX) +        /* Stack memory */
                                           (sizeof(fr_pair_t) * 5) +            /* pair lists and root*/
-                                          (sizeof(fr_radius_packet_t) * 2) +   /* packets */
+                                          (sizeof(fr_packet_t) * 2) +  /* packets */
                                           128                                  /* extra */
                                           ));
        fr_assert(ctx != request);
@@ -717,11 +717,11 @@ void request_global_free(void)
  *     Verify a packet.
  */
 static void packet_verify(char const *file, int line,
-                         request_t const *request, fr_radius_packet_t const *packet, fr_pair_list_t *list, char const *type)
+                         request_t const *request, fr_packet_t const *packet, fr_pair_list_t *list, char const *type)
 {
        TALLOC_CTX *parent;
 
-       fr_fatal_assert_msg(packet, "CONSISTENCY CHECK FAILED %s[%i]: fr_radius_packet_t %s pointer was NULL",
+       fr_fatal_assert_msg(packet, "CONSISTENCY CHECK FAILED %s[%i]: fr_packet_t %s pointer was NULL",
                            file, line, type);
 
        parent = talloc_parent(packet);
@@ -730,7 +730,7 @@ static void packet_verify(char const *file, int line,
                if (parent) fr_log_talloc_report(parent);
 
 
-               fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%i]: Expected fr_radius_packet_t %s to be parented "
+               fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%i]: Expected fr_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 fb06a1e3d9eaf461cbc3c82e041ef8b867997116..d2bd500880ac7195f4a77a06ad384a9e929ffa10 100644 (file)
@@ -223,8 +223,8 @@ struct request_s {
        char const              *component;     //!< Section the request is in.
        char const              *module;        //!< Module the request is currently being processed by.
 
-       fr_radius_packet_t      *packet;        //!< Incoming request.
-       fr_radius_packet_t      *reply;         //!< Outgoing response.
+       fr_packet_t     *packet;        //!< Incoming request.
+       fr_packet_t     *reply;         //!< Outgoing response.
 
        fr_client_t             *client;        //!< The client that originally sent us the request.
 
index 83f15f5dc9cc5bb095236d030bcbde6ca85bceaf..01ef164f4b4a89d645ceff084ac5ec799c6011f9 100644 (file)
@@ -1067,7 +1067,7 @@ void                      tmpl_debug(tmpl_t const *vpt) CC_HINT(nonnull);
 
 fr_pair_list_t         *tmpl_list_head(request_t *request, fr_dict_attr_t const *list);
 
-fr_radius_packet_t     *tmpl_packet_ptr(request_t *request, fr_dict_attr_t const *list) CC_HINT(nonnull);
+fr_packet_t    *tmpl_packet_ptr(request_t *request, fr_dict_attr_t const *list) CC_HINT(nonnull);
 
 TALLOC_CTX             *tmpl_list_ctx(request_t *request, fr_dict_attr_t const *list);
 
index 884b603c32f2f77ec718a02817efb40b5d41033e..34df081ac615d68f25d495b429bb1e595d87789d 100644 (file)
@@ -99,8 +99,8 @@ fr_pair_list_t *tmpl_list_head(request_t *request, fr_dict_attr_t const *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 #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
+ * #fr_pair_t should be allocated in the context of a #fr_packet_t, so that if the
+ * #fr_packet_t is freed before the #request_t, the associated #fr_pair_t lists are
  * freed too.
  *
  * @param[in] request containing the target lists.
@@ -128,20 +128,20 @@ TALLOC_CTX *tmpl_list_ctx(request_t *request, fr_dict_attr_t const *list)
        return NULL;
 }
 
-/** Resolve a list to the #fr_radius_packet_t holding the HEAD pointer for a #fr_pair_t list
+/** Resolve a list to the #fr_packet_t holding the HEAD pointer for a #fr_pair_t list
  *
- * Returns a pointer to the #fr_radius_packet_t that holds the HEAD pointer of a given list,
+ * Returns a pointer to the #fr_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 #fr_pair_list_t value to resolve to #fr_radius_packet_t.
+ * @param[in] list #fr_pair_list_t value to resolve to #fr_packet_t.
  * @return
- *     - #fr_radius_packet_t on success.
+ *     - #fr_packet_t on success.
  *     - NULL on failure.
  *
  * @see tmpl_pair_list
  */
-fr_radius_packet_t *tmpl_packet_ptr(request_t *request, fr_dict_attr_t const *list)
+fr_packet_t *tmpl_packet_ptr(request_t *request, fr_dict_attr_t const *list)
 {
        if (list == request_attr_request) return request->packet;
 
index d5216f58cd20e823eb886ed5242bf6dde1f2d80b..510b8a049792ec51129a9145aceebbfc73f230af 100644 (file)
@@ -14,7 +14,7 @@
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-/** fr_radius_packet_t alloc/free functions
+/** fr_packet_t alloc/free functions
  *
  * @file src/lib/util/packet.c
  *
@@ -26,20 +26,20 @@ RCSID("$Id$")
 #include <freeradius-devel/util/packet.h>
 #include <freeradius-devel/util/rand.h>
 
-/** Allocate a new fr_radius_packet_t
+/** Allocate a new fr_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 fr_radius_packet_t.
+ *     - New fr_packet_t.
  *     - NULL on error.
  */
-fr_radius_packet_t *fr_radius_packet_alloc(TALLOC_CTX *ctx, bool new_vector)
+fr_packet_t *fr_radius_packet_alloc(TALLOC_CTX *ctx, bool new_vector)
 {
-       fr_radius_packet_t      *rp;
+       fr_packet_t     *rp;
 
-       rp = talloc_zero(ctx, fr_radius_packet_t);
+       rp = talloc_zero(ctx, fr_packet_t);
        if (!rp) {
                fr_strerror_const("out of memory");
                return NULL;
@@ -51,18 +51,18 @@ fr_radius_packet_t *fr_radius_packet_alloc(TALLOC_CTX *ctx, bool new_vector)
        return rp;
 }
 
-/** Allocate a new fr_radius_packet_t response
+/** Allocate a new fr_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 fr_radius_packet_t.
+ *     - New fr_packet_t.
  *     - NULL on error.
  */
-fr_radius_packet_t *fr_radius_packet_alloc_reply(TALLOC_CTX *ctx, fr_radius_packet_t *packet)
+fr_packet_t *fr_radius_packet_alloc_reply(TALLOC_CTX *ctx, fr_packet_t *packet)
 {
-       fr_radius_packet_t *reply;
+       fr_packet_t *reply;
 
        if (!packet) return NULL;
 
@@ -83,12 +83,12 @@ fr_radius_packet_t *fr_radius_packet_alloc_reply(TALLOC_CTX *ctx, fr_radius_pack
 }
 
 
-/** Free a fr_radius_packet_t
+/** Free a fr_packet_t
  *
  */
-void fr_radius_packet_free(fr_radius_packet_t **packet_p)
+void fr_radius_packet_free(fr_packet_t **packet_p)
 {
-       fr_radius_packet_t *packet;
+       fr_packet_t *packet;
 
        if (!packet_p || !*packet_p) return;
        packet = *packet_p;
index 71de57dbe439a53ebd2859ce13247d4f13e1aa22..f579a21d3f9b5da7317eb46e8e63e3ea8ad22dac 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, fr_radius_packet_t)
+#  define PACKET_VERIFY(_x)    (void) talloc_get_type_abort_const(_x, fr_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 fr_radius_packet_t as well before calling fr_radius_packet_send
+ *                     response fr_packet_t as well before calling fr_radius_packet_send
  *
  *     verified:       Filled in by rad_decode for accounting-request packets
  *
@@ -74,11 +74,11 @@ typedef struct {
        size_t                  partial;
 
        void                    *uctx;
-} fr_radius_packet_t;
+} fr_packet_t;
 
-fr_radius_packet_t     *fr_radius_packet_alloc(TALLOC_CTX *ctx, bool new_vector);
-fr_radius_packet_t     *fr_radius_packet_alloc_reply(TALLOC_CTX *ctx, fr_radius_packet_t *);
-void           fr_radius_packet_free(fr_radius_packet_t **);
+fr_packet_t    *fr_radius_packet_alloc(TALLOC_CTX *ctx, bool new_vector);
+fr_packet_t    *fr_radius_packet_alloc_reply(TALLOC_CTX *ctx, fr_packet_t *);
+void           fr_radius_packet_free(fr_packet_t **);
 
 #ifdef __cplusplus
 }
index 38892de6cc18e3c3aa1872b5259fadc8b7131b75..680b2b30a66c6f94ec65a12b1d89b0238eaa474c 100644 (file)
@@ -266,7 +266,7 @@ fr_pair_t *fr_pair_root_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da)
  *
  * @note Will duplicate any unknown attributes passed as the da.
  *
- * @param[in] ctx      for allocated memory, usually a pointer to a #fr_radius_packet_t
+ * @param[in] ctx      for allocated memory, usually a pointer to a #fr_packet_t
  * @param[in] da       Specifies the dictionary attribute to build the #fr_pair_t from.
  *                     If unknown, will be duplicated, with the memory being bound to
  *                     the pair.
@@ -356,7 +356,7 @@ int fr_pair_reinit_from_da(fr_pair_list_t *list, fr_pair_t *vp, fr_dict_attr_t c
  * 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 #fr_radius_packet_t.
+ * @param[in] ctx      for allocated memory, usually a pointer to a #fr_packet_t.
  * @param[in] parent   of the attribute being allocated (usually a dictionary or vendor).
  * @param[in] attr     number.
  * @return
@@ -392,7 +392,7 @@ fr_pair_t *fr_pair_afrom_child_num(TALLOC_CTX *ctx, fr_dict_attr_t const *parent
  *
  *  Unlike fr_pair_afrom_da_nested(), this function starts off at an intermediate ctx and list.
  *
- * @param[in] ctx      for allocated memory, usually a pointer to a #fr_radius_packet_t.
+ * @param[in] ctx      for allocated memory, usually a pointer to a #fr_packet_t.
  * @param[out] list    where the created pair is supposed to go.
  * @param[in] da       the da for the pair to create
  * @param[in] start    the starting depth. If start != 0, we must have ctx==vp at that depth, and list==&vp->vp_group
@@ -452,7 +452,7 @@ fr_pair_t *fr_pair_afrom_da_depth_nested(TALLOC_CTX *ctx, fr_pair_list_t *list,
  *  This function is similar to fr_pair_update_by_da_parent(), except that function requires
  *  a parent pair, and this one takes a separate talloc ctx and pair list.
  *
- * @param[in] ctx      for allocated memory, usually a pointer to a #fr_radius_packet_t.
+ * @param[in] ctx      for allocated memory, usually a pointer to a #fr_packet_t.
  * @param[out] list    where the created pair is supposed to go.
  * @param[in] da       the da for the pair to create
  * @return
index d8961a5a96e077ba7a09530865fd8888a1192fab..2190d978b194ad2dbf847e359ee6e5be65b851fe 100644 (file)
@@ -193,7 +193,7 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        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;
        fr_client_t const *client;
-       fr_radius_packet_t *packet = request->packet;
+       fr_packet_t *packet = request->packet;
 
        /*
         *      Set the request dictionary so that we can do
index 6906ee081f8625111c8d35043aa95fc8d10baccb..f3a36783f1ec5d6bdaa48d11b09b74aca66a3229 100644 (file)
@@ -193,7 +193,7 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        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;
        fr_client_t const               *client;
-       fr_radius_packet_t      *packet = request->packet;
+       fr_packet_t     *packet = request->packet;
 
        /*
         *      Set the request dictionary so that we can do
index 0bb1cd929e46ccb4741a361c17021eebbcc6fd15..4aefa021d373bde5bc5c451c22b2db594d54eb6a 100644 (file)
@@ -181,7 +181,7 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        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;
        fr_client_t const *client;
-       fr_radius_packet_t *packet = request->packet;
+       fr_packet_t *packet = request->packet;
 
        fr_assert(data[0] < FR_VMPS_CODE_MAX);
 
index c8ff1fbae3a42d9e5ec089d5ccb3857f5cbd5396..bad95a7a399984a8666995193669f21bb97bc015 100644 (file)
@@ -188,7 +188,7 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  */
 static unlang_action_t CC_HINT(nonnull(1,2)) attr_filter_common(rlm_rcode_t *p_result,
                                                                module_ctx_t const *mctx, request_t *request,
-                                                               fr_radius_packet_t *packet, fr_pair_list_t *list)
+                                                               fr_packet_t *packet, fr_pair_list_t *list)
 {
        rlm_attr_filter_t const *inst = talloc_get_type_abort_const(mctx->inst->data, rlm_attr_filter_t);
        fr_pair_list_t  output;
index c3879afd4746ff3610dedf2c251b063ae4996665..a260de673fd9187f488ba84e23eb695973ae5e82 100644 (file)
@@ -221,7 +221,7 @@ static void detail_fr_pair_fprint(TALLOC_CTX *ctx, FILE *out, fr_pair_t const *s
  * @param[in] compat Write out entry in compatibility mode.
  */
 static int detail_write(FILE *out, rlm_detail_t const *inst, request_t *request, fr_value_box_t *header,
-                       fr_radius_packet_t *packet, fr_pair_list_t *list, bool compat, fr_hash_table_t *ht)
+                       fr_packet_t *packet, fr_pair_list_t *list, bool compat, fr_hash_table_t *ht)
 {
        if (fr_pair_list_empty(list)) {
                RWDEBUG("Skipping empty packet");
@@ -322,7 +322,7 @@ static int detail_write(FILE *out, rlm_detail_t const *inst, request_t *request,
  *     Do detail, compatible with old accounting
  */
 static unlang_action_t CC_HINT(nonnull) detail_do(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request,
-                                                 fr_radius_packet_t *packet, fr_pair_list_t *list,
+                                                 fr_packet_t *packet, fr_pair_list_t *list,
                                                  bool compat)
 {
        rlm_detail_env_t        *env = talloc_get_type_abort(mctx->env_data, rlm_detail_env_t);
index 5931794bda1d8cab17d129694f6ebc3e346e1c23..049ef12bf1d51c0c05155e5c231e0bd659613a12 100644 (file)
@@ -477,7 +477,7 @@ ssize_t eap_fast_decode_pair(TALLOC_CTX *ctx, fr_pair_list_t *out, 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,
-                                                 fr_radius_packet_t *reply, fr_pair_list_t *reply_list)
+                                                 fr_packet_t *reply, fr_pair_list_t *reply_list)
 {
        rlm_rcode_t                     rcode = RLM_MODULE_REJECT;
        fr_pair_t                       *vp;
index 5936d12e86c7dafb7bf1f053ebd609865c54a949..3a83b95c1b65b20afc1f667970a268b2a666b899 100644 (file)
@@ -277,7 +277,7 @@ static int eap_peap_check_tlv(request_t *request, uint8_t const *data, size_t da
  */
 static rlm_rcode_t CC_HINT(nonnull) process_reply(eap_session_t *eap_session, fr_tls_session_t *tls_session,
                                                  request_t *request,
-                                                 fr_radius_packet_t *reply, fr_pair_list_t *reply_list)
+                                                 fr_packet_t *reply, fr_pair_list_t *reply_list)
 {
        rlm_rcode_t rcode = RLM_MODULE_REJECT;
        fr_pair_list_t vps;
index 7e7caade8ef45f8deab1f0ce166b15092c791053..7f54bb0d2bd3395a9c088b0c09a15b79ce836da1 100644 (file)
@@ -497,7 +497,7 @@ static int vp2diameter(request_t *request, fr_tls_session_t *tls_session, fr_pai
  */
 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,
-                                                 fr_radius_packet_t *reply, fr_pair_list_t *reply_list)
+                                                 fr_packet_t *reply, fr_pair_list_t *reply_list)
 {
        rlm_rcode_t     rcode = RLM_MODULE_REJECT;
        fr_pair_t       *vp;
index a340de09bc49c6b88cd9baae7731bdbc6cc37313..2bf85cc0f69ef03f46dc0ca1fc2f60171eaabfbd 100644 (file)
@@ -72,7 +72,7 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  *     A lie!  It always returns!
  */
 static unlang_action_t sometimes_return(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request,
-                                       fr_radius_packet_t *packet, fr_radius_packet_t *reply)
+                                       fr_packet_t *packet, fr_packet_t *reply)
 {
        rlm_sometimes_t const   *inst = talloc_get_type_abort_const(mctx->inst->data, rlm_sometimes_t);
        uint32_t                hash;
index 0cb807dc116ad1675c9af442ca236eb2bbfed4e2..059e4a5e26b4cc5f6fd451444507cbd58e072470 100644 (file)
@@ -160,7 +160,7 @@ static fr_process_state_t const process_state[] = {
 /*
  *     Debug the packet if requested.
  */
-static void arp_packet_debug(request_t *request, fr_radius_packet_t const *packet, fr_pair_list_t const *list, bool received)
+static void arp_packet_debug(request_t *request, fr_packet_t const *packet, fr_pair_list_t const *list, bool received)
 {
        if (!packet) return;
        if (!RDEBUG_ENABLED) return;
index 85f06f3b800286caca1a19a4e716d8647756a745..7bcde3c7a528dbd4104c222904ee6dd1f89fd1a4 100644 (file)
@@ -79,7 +79,7 @@ typedef struct {
 /*
  *     Debug the packet if requested.
  */
-static void bfd_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_pair_list_t *list, bool received)
+static void bfd_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index 7296b8b8863604239de09b3dd07f6813a22b73c1..e980dd23d62fe4f6011583d56d64ec9eac165e61 100644 (file)
@@ -53,7 +53,7 @@ fr_dict_attr_autoload_t process_dhcpv4_dict_attr[] = {
 /*
  *     Debug the packet if requested.
  */
-static void dhcpv4_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_pair_list_t *list, bool received)
+static void dhcpv4_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index 1041dc3cd6c38af90d133b5198f473bc02beae10..0f42a0ddb9c531ba640fa1fc87934f352904ad81 100644 (file)
@@ -287,7 +287,7 @@ static const virtual_server_compile_t compile_list[] = {
 /*
  *     Debug the packet if requested.
  */
-static void dhcpv6_packet_debug(request_t *request, fr_radius_packet_t const *packet, fr_pair_list_t const *list, bool received)
+static void dhcpv6_packet_debug(request_t *request, fr_packet_t const *packet, fr_pair_list_t const *list, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index 924d86deabbefd55cb98be47af6413afa71b0f25..cec2af3ef12f6de50c860a92aa7aecf3de984a34 100644 (file)
@@ -127,7 +127,7 @@ static fr_process_state_t const process_state[] = {
 /*
  *     Debug the packet if requested.
  */
-static void dns_packet_debug(request_t *request, fr_radius_packet_t const *packet, fr_pair_list_t const *list, bool received)
+static void dns_packet_debug(request_t *request, fr_packet_t const *packet, fr_pair_list_t const *list, bool received)
 {
        if (!packet) return;
        if (!RDEBUG_ENABLED) return;
index d185c16bae6d92e50dcf8d7fb7531bacc79c53f0..a36e06ae7b56befa3306d7ba7f1633bfaa6cc641 100644 (file)
@@ -57,7 +57,7 @@ static char const *ldap_sync_message_types[FR_LDAP_SYNC_CODE_MAX] = {
        "Cookie-Store-Response",
 };
 
-static void ldap_sync_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_pair_list_t *list, bool received)
+static void ldap_sync_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
 
        if (!packet) return;
index 4e4c9e7ee844e718ac1784b38776da74b776f608..52a39d49749e40d57c2b022a7ba3f5568d45987a 100644 (file)
@@ -219,7 +219,7 @@ static const conf_parser_t config[] = {
 /*
  *     Debug the packet if requested.
  */
-static void radius_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_pair_list_t *list, bool received)
+static void radius_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index 531d3f1180e57b5041f7a9e7d4e2309be146b145..a353b9389f5bdd1e503f492a199c46c0cb41ecb9 100644 (file)
@@ -202,7 +202,7 @@ static const conf_parser_t config[] = {
 /*
  *     Debug the packet if requested.
  */
-static void radius_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_pair_list_t *list, bool received)
+static void radius_packet_debug(request_t *request, fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index fb206d60ebcd80f620a4589092a0051ebc8380d2..3c8dcbe9207be4bcae2676f1a0c954081f92cfce 100644 (file)
@@ -162,7 +162,7 @@ static fr_process_state_t const process_state[] = {
 /*
  *     Debug the packet if requested.
  */
-static void vmps_packet_debug(request_t *request, fr_radius_packet_t const *packet, fr_pair_list_t const *list, bool received)
+static void vmps_packet_debug(request_t *request, fr_packet_t const *packet, fr_pair_list_t const *list, bool received)
 {
 #ifdef WITH_IFINDEX_NAME_RESOLUTION
        char if_name[IFNAMSIZ];
index 3600066b4b6e0e4cded0844c427df0aebd53f7a4..76c832f04ee6fffbc085bbf3850ea4adb4aafb11 100644 (file)
@@ -201,7 +201,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 fr_radius_packet_t structure if it is
+/** Check received DHCP request is valid and build fr_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 8bc8ef111ad843dfa569f65df08644ae79f61c62..cd584b95c8f45e3b631c55a083876bb03f9f08c5 100644 (file)
@@ -160,7 +160,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);
-fr_radius_packet_t     *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len);
+fr_packet_t    *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len);
 bool           fr_dhcpv4_is_encodable(void const *item, void const *uctx);
 void           *fr_dhcpv4_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx);
 ssize_t                fr_dhcpv4_encode(uint8_t *buffer, size_t buflen, dhcp_packet_t *original, int code, uint32_t xid, fr_pair_list_t *vps);
@@ -192,7 +192,7 @@ uint8_t const       *fr_dhcpv4_packet_get_option(dhcp_packet_t const *packet, size_t p
 int            fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out,
                                 uint8_t const *data, size_t data_len, unsigned int *code);
 
-int            fr_dhcpv4_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list);
+int            fr_dhcpv4_packet_encode(fr_packet_t *packet, fr_pair_list_t *list);
 
 #ifdef HAVE_LINUX_IF_PACKET_H
 /*
@@ -202,10 +202,10 @@ int               fr_dhcpv4_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list);
 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,
-                                         fr_radius_packet_t *packet, fr_pair_list_t *list);
+                                         fr_packet_t *packet, fr_pair_list_t *list);
 
-fr_radius_packet_t     *fr_dhcpv4_raw_packet_recv(int sockfd, struct sockaddr_ll *p_ll,
-                                                 fr_radius_packet_t *request, fr_pair_list_t *list);
+fr_packet_t    *fr_dhcpv4_raw_packet_recv(int sockfd, struct sockaddr_ll *p_ll,
+                                                 fr_packet_t *request, fr_pair_list_t *list);
 #endif
 
 /*
@@ -215,16 +215,16 @@ fr_radius_packet_t        *fr_dhcpv4_raw_packet_recv(int sockfd, struct sockaddr_ll *p_
 /*
  *     Use fr_pcap_init and fr_pcap_open to create/open handles.
  */
-fr_radius_packet_t     *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap);
+fr_packet_t    *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap);
 
-int            fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, fr_radius_packet_t *packet);
+int            fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, fr_packet_t *packet);
 #endif
 
 /*
  *     udp.c
  */
-fr_radius_packet_t     *fr_dhcpv4_udp_packet_recv(int sockfd);
-int            fr_dhcpv4_udp_packet_send(fr_radius_packet_t *packet);
+fr_packet_t    *fr_dhcpv4_udp_packet_recv(int sockfd);
+int            fr_dhcpv4_udp_packet_send(fr_packet_t *packet);
 
 #ifdef __cplusplus
 }
index 79a3c8e25d1ff2eeb7f37198daa48d33a8fda563..28c98867de1e5f62b1d975e1db30e0b6b4061d5c 100644 (file)
@@ -370,7 +370,7 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data,
        return 0;
 }
 
-int fr_dhcpv4_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list)
+int fr_dhcpv4_packet_encode(fr_packet_t *packet, fr_pair_list_t *list)
 {
        ssize_t         len;
        fr_pair_t       *vp;
@@ -398,9 +398,9 @@ int fr_dhcpv4_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list)
        return 0;
 }
 
-fr_radius_packet_t *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len)
+fr_packet_t *fr_dhcpv4_packet_alloc(uint8_t const *data, ssize_t data_len)
 {
-       fr_radius_packet_t *packet;
+       fr_packet_t *packet;
        uint32_t        magic;
        uint8_t const   *code;
 
index 3e3c374c246390e5af3eef287e7b5e28761db365..47dee0495a110ff0de0eac1c21d151dae1d25678 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, fr_radius_packet_t *packet)
+int fr_dhcpv4_pcap_send(fr_pcap_t *pcap, uint8_t *dst_ether_addr, fr_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, fr_radius_pack
  *
  * @param pcap handle
  * @return
- *     - pointer to fr_radius_packet_t if successful.
+ *     - pointer to fr_packet_t if successful.
  *     - NULL if failed.
  */
-fr_radius_packet_t *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap)
+fr_packet_t *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap)
 {
        int                     ret;
 
@@ -120,7 +120,7 @@ fr_radius_packet_t *fr_dhcpv4_pcap_recv(fr_pcap_t *pcap)
        uint16_t                src_port, dst_port;
        struct pcap_pkthdr      *header;
        ssize_t                 link_len, len;
-       fr_radius_packet_t              *packet;
+       fr_packet_t             *packet;
 
        /*
         *      Pointers into the packet data we just received
index e93ce081ac31b725ded611441ab756864d2a1fe8..f565e5dc52a02d626505ba9e42c90a89f6f0aa49 100644 (file)
@@ -99,7 +99,7 @@ int fr_dhcpv4_raw_socket_open(struct sockaddr_ll *link_layer, int ifindex)
  *     - -1 on failure.
  */
 int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *link_layer,
-                             fr_radius_packet_t *packet, fr_pair_list_t *list)
+                             fr_packet_t *packet, fr_pair_list_t *list)
 {
        uint8_t                 dhcp_packet[1518] = { 0 };
        ethernet_header_t       *eth_hdr = (ethernet_header_t *)dhcp_packet;
@@ -166,11 +166,11 @@ int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *link_layer,
  *
  *     FIXME: split this into two, recv_raw_packet, and verify(packet, original)
  */
-fr_radius_packet_t *fr_dhcpv4_raw_packet_recv(int sockfd, struct sockaddr_ll *link_layer,
-                                            fr_radius_packet_t *request, fr_pair_list_t *list)
+fr_packet_t *fr_dhcpv4_raw_packet_recv(int sockfd, struct sockaddr_ll *link_layer,
+                                            fr_packet_t *request, fr_pair_list_t *list)
 {
        fr_pair_t               *vp;
-       fr_radius_packet_t              *packet;
+       fr_packet_t             *packet;
        dhcp_packet_t           *dhcp_data;
        uint8_t const           *code;
        uint32_t                magic, xid;
index 726de4357321b98031f13b91308b449d5f76f5e4..ab4ad5ed2201c5e327faa9f9374efecff886a9e4 100644 (file)
@@ -38,7 +38,7 @@
  *     - >= 0 if successful.
  *     - < 0 if failed.
  */
-int fr_dhcpv4_udp_packet_send(fr_radius_packet_t *packet)
+int fr_dhcpv4_udp_packet_send(fr_packet_t *packet)
 {
        int ret;
        struct sockaddr_storage dst;
@@ -68,16 +68,16 @@ int fr_dhcpv4_udp_packet_send(fr_radius_packet_t *packet)
  *
  * @param sockfd handle.
  * @return
- *     - pointer to fr_radius_packet_t if successful.
+ *     - pointer to fr_packet_t if successful.
  *     - NULL if failed.
  */
-fr_radius_packet_t *fr_dhcpv4_udp_packet_recv(int sockfd)
+fr_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;
-       fr_radius_packet_t              *packet;
+       fr_packet_t             *packet;
        uint8_t                 *data;
        ssize_t                 data_len;
        fr_ipaddr_t             src_ipaddr, dst_ipaddr;
@@ -136,4 +136,3 @@ fr_radius_packet_t *fr_dhcpv4_udp_packet_recv(int sockfd)
        packet->timestamp = when;
        return packet;
 }
-
index af86c1e9645fdd8cc9122cdf3015aae4a664c169..2dc174d2743281c6ed5361e9527610bb45893e6f 100644 (file)
@@ -82,7 +82,7 @@ fr_radius_client_fd_bio_t *fr_radius_client_fd_bio_alloc(TALLOC_CTX *ctx, size_t
        return my;
 }
 
-int fr_radius_client_fd_bio_write(fr_radius_client_fd_bio_t *my, UNUSED void *packet_ctx, fr_radius_packet_t *packet, fr_pair_list_t *list)
+int fr_radius_client_fd_bio_write(fr_radius_client_fd_bio_t *my, UNUSED void *packet_ctx, fr_packet_t *packet, fr_pair_list_t *list)
 {
        ssize_t slen;
 
@@ -131,13 +131,13 @@ static const fr_radius_packet_code_t allowed_replies[FR_RADIUS_CODE_MAX] = {
        [FR_RADIUS_CODE_PROTOCOL_ERROR]         = FR_RADIUS_CODE_PROTOCOL_ERROR,        /* Any */
 };
 
-int fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, UNUSED void *packet_ctx, fr_radius_packet_t **packet_p,
+int fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, UNUSED void *packet_ctx, fr_packet_t **packet_p,
                                 TALLOC_CTX *ctx, fr_pair_list_t *out)
 {
        int code;
        ssize_t slen;
        fr_radius_client_fd_bio_t *my = talloc_get_type_abort(bio, fr_radius_client_fd_bio_t);
-       fr_radius_packet_t *packet, *reply;
+       fr_packet_t *packet, *reply;
        fr_bio_fd_packet_ctx_t fd_ctx;
 
        slen = fr_bio_read(my->common.bio, &fd_ctx, &my->buffer, sizeof(my->buffer));
@@ -227,7 +227,7 @@ int fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, UNUSED void *packet_ctx,
 /** Release (or cancel) an outgoing packet.
  *
  */
-int fr_radius_client_fd_bio_release(fr_bio_packet_t *bio, UNUSED void *packet_ctx, fr_radius_packet_t *packet)
+int fr_radius_client_fd_bio_release(fr_bio_packet_t *bio, UNUSED void *packet_ctx, fr_packet_t *packet)
 {
        fr_radius_client_fd_bio_t *my = talloc_get_type_abort(bio, fr_radius_client_fd_bio_t);
 
index 7c6a7eaf7c00ea64c004832042677be8d67603c8..457fde31edf98da63cfe9daed41cd8f9363e763b 100644 (file)
@@ -50,8 +50,8 @@ typedef struct {
 
 fr_radius_client_fd_bio_t *fr_radius_client_fd_bio_alloc(TALLOC_CTX *ctx, size_t read_size, fr_radius_client_config_t *cfg, fr_bio_fd_config_t const *fd_cfg) CC_HINT(nonnull);
 
-int    fr_radius_client_fd_bio_write(fr_radius_client_fd_bio_t *my, void *packet_ctx, fr_radius_packet_t *packet, fr_pair_list_t *list);
+int    fr_radius_client_fd_bio_write(fr_radius_client_fd_bio_t *my, void *packet_ctx, fr_packet_t *packet, fr_pair_list_t *list);
 
-int    fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t **packet_p, TALLOC_CTX *ctx, fr_pair_list_t *list);
+int    fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t **packet_p, TALLOC_CTX *ctx, fr_pair_list_t *list);
 
-int    fr_radius_client_fd_bio_release(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t *packet);
+int    fr_radius_client_fd_bio_release(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t *packet);
index 6a9d2dbcc25f26e5fadaf408155503f05adb447a..f30dad0f72c93b446a3f2256403691711972a80f 100644 (file)
@@ -31,7 +31,7 @@ RCSID("$Id$")
 /**  Allocate an ID, and write one packet.
  *
  */
-static int fr_radius_client_tcp_bio_write(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t *packet, fr_pair_list_t *list)
+static int fr_radius_client_tcp_bio_write(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t *packet, fr_pair_list_t *list)
 {
        fr_radius_client_fd_bio_t *my = talloc_get_type_abort(bio, fr_radius_client_fd_bio_t);
 
index e6589e1e10ce8f5ec07130d9e84a5439a34acf7f..a329889148fe39b7c089809649300b4b79007ac3 100644 (file)
@@ -31,7 +31,7 @@ RCSID("$Id$")
 /**  Allocate an ID, and write one packet.
  *
  */
-static int fr_radius_client_udp_bio_write(fr_bio_packet_t *bio, void *packet_ctx, fr_radius_packet_t *packet, fr_pair_list_t *list)
+static int fr_radius_client_udp_bio_write(fr_bio_packet_t *bio, void *packet_ctx, fr_packet_t *packet, fr_pair_list_t *list)
 {
        ssize_t slen;
        fr_radius_client_fd_bio_t *my = talloc_get_type_abort(bio, fr_radius_client_fd_bio_t);
@@ -65,6 +65,3 @@ fr_bio_packet_t *fr_radius_client_udp_bio_alloc(TALLOC_CTX *ctx, fr_radius_clien
 
        return (fr_bio_packet_t *) my;
 }
-
-
-
index 409f9fe5aaf88ad2ba464640b4dda9b23022eeb5..3b8b634aa5982bc2342b06b9193f8a03b9a62376 100644 (file)
@@ -32,15 +32,15 @@ struct fr_radius_id_s {
        int                     free_start;
        int                     free_end;
 
-       fr_radius_packet_t      *packet[256];   //!< pointer to packet data
-       
+       fr_packet_t             *packet[256];   //!< pointer to packet data
+
        int                     free_ids[256];
 };
 
 
 
 /** Allocate a tracking structure for one packet code.
- *     
+ *
  */
 fr_radius_id_t *fr_radius_id_alloc(TALLOC_CTX *ctx)
 {
@@ -62,9 +62,9 @@ fr_radius_id_t *fr_radius_id_alloc(TALLOC_CTX *ctx)
 }
 
 /** Allocate an ID for a packet, using LRU
- *     
+ *
  */
-int fr_radius_id_pop(fr_radius_id_t *track, fr_radius_packet_t *packet)
+int fr_radius_id_pop(fr_radius_id_t *track, fr_packet_t *packet)
 {
        int id;
 
@@ -89,9 +89,9 @@ int fr_radius_id_pop(fr_radius_id_t *track, fr_radius_packet_t *packet)
 }
 
 /** De-allocate an ID for a packet, using LRU
- *     
+ *
  */
-int fr_radius_id_push(fr_radius_id_t *track, fr_radius_packet_t const *packet)
+int fr_radius_id_push(fr_radius_id_t *track, fr_packet_t const *packet)
 {
        fr_assert(packet->id >= 0);
        fr_assert(packet->id < 256);
@@ -114,7 +114,7 @@ int fr_radius_id_push(fr_radius_id_t *track, fr_radius_packet_t const *packet)
        return 0;
 }
 
-fr_radius_packet_t *fr_radius_id_find(fr_radius_id_t *track, int id)
+fr_packet_t *fr_radius_id_find(fr_radius_id_t *track, int id)
 {
        fr_assert(id >= 0);
        fr_assert(id < 256);
index 603e80d1b031af8645cca4f422b256dfb8c30b42..330636b66339ce997fb6f44d4d767294e2f116e3 100644 (file)
@@ -33,11 +33,11 @@ typedef fr_radius_id_t *fr_radius_code_id_t[FR_RADIUS_CODE_MAX];
 
 fr_radius_id_t *fr_radius_id_alloc(TALLOC_CTX *ctx);
 
-int            fr_radius_id_pop(fr_radius_id_t *track, fr_radius_packet_t *packet) CC_HINT(nonnull);
+int            fr_radius_id_pop(fr_radius_id_t *track, fr_packet_t *packet) CC_HINT(nonnull);
 
-int            fr_radius_id_push(fr_radius_id_t *track, fr_radius_packet_t const *packet) CC_HINT(nonnull);
+int            fr_radius_id_push(fr_radius_id_t *track, fr_packet_t const *packet) CC_HINT(nonnull);
 
-fr_radius_packet_t *fr_radius_id_find(fr_radius_id_t *track, int id) CC_HINT(nonnull);
+fr_packet_t *fr_radius_id_find(fr_radius_id_t *track, int id) CC_HINT(nonnull);
 
 static inline CC_HINT(nonnull) int fr_radius_code_id_alloc(TALLOC_CTX *ctx, fr_radius_code_id_t codes, int code)
 {
@@ -52,7 +52,7 @@ static inline CC_HINT(nonnull) int fr_radius_code_id_alloc(TALLOC_CTX *ctx, fr_r
        return 0;
 }
 
-static inline CC_HINT(nonnull) int fr_radius_code_id_pop(fr_radius_code_id_t codes, fr_radius_packet_t *packet)
+static inline CC_HINT(nonnull) int fr_radius_code_id_pop(fr_radius_code_id_t codes, fr_packet_t *packet)
 {
        fr_assert(packet->code > 0);
        fr_assert(packet->code < FR_RADIUS_CODE_MAX);
@@ -62,7 +62,7 @@ static inline CC_HINT(nonnull) int fr_radius_code_id_pop(fr_radius_code_id_t cod
        return fr_radius_id_pop(codes[packet->code], packet);
 }
 
-static inline CC_HINT(nonnull) int fr_radius_code_id_push(fr_radius_code_id_t codes, fr_radius_packet_t const *packet)
+static inline CC_HINT(nonnull) int fr_radius_code_id_push(fr_radius_code_id_t codes, fr_packet_t const *packet)
 {
        fr_assert(packet->code > 0);
        fr_assert(packet->code < FR_RADIUS_CODE_MAX);
@@ -72,7 +72,7 @@ static inline CC_HINT(nonnull) int fr_radius_code_id_push(fr_radius_code_id_t co
        return fr_radius_id_push(codes[packet->code], packet);
 }
 
-static inline CC_HINT(nonnull) fr_radius_packet_t *fr_radius_code_id_find(fr_radius_code_id_t codes, int code, int id)
+static inline CC_HINT(nonnull) fr_packet_t *fr_radius_code_id_find(fr_radius_code_id_t codes, int code, int id)
 {
        fr_assert(code > 0);
        fr_assert(code < FR_RADIUS_CODE_MAX);
@@ -81,4 +81,3 @@ static inline CC_HINT(nonnull) fr_radius_packet_t *fr_radius_code_id_find(fr_rad
 
        return fr_radius_id_find(codes[code], id);
 }
-
index 749b2bfec80357131380938518bff100a84ed628..3d7a602f296f57c39e0c813376d35d874195627b 100644 (file)
@@ -42,7 +42,7 @@ RCSID("$Id$")
  */
 int8_t fr_packet_cmp(void const *a_v, void const *b_v)
 {
-       fr_radius_packet_t const *a = a_v, *b = b_v;
+       fr_packet_t const *a = a_v, *b = b_v;
        int8_t ret;
 
        /*
@@ -69,8 +69,8 @@ int8_t fr_packet_cmp(void const *a_v, void const *b_v)
 /*
  *     Create a fake "request" from a reply, for later lookup.
  */
-void fr_request_from_reply(fr_radius_packet_t *request,
-                          fr_radius_packet_t const *reply)
+void fr_request_from_reply(fr_packet_t *request,
+                          fr_packet_t const *reply)
 {
        fr_socket_addr_swap(&request->socket, &reply->socket);
        request->id = reply->id;
@@ -280,7 +280,7 @@ fr_packet_list_t *fr_packet_list_create(int alloc_id)
 
        pl = talloc_zero(NULL, fr_packet_list_t);
        if (!pl) return NULL;
-       pl->tree = fr_rb_inline_alloc(pl, fr_radius_packet_t, node, fr_packet_cmp, NULL);       /* elements not talloc safe */
+       pl->tree = fr_rb_inline_alloc(pl, fr_packet_t, node, fr_packet_cmp, NULL);      /* elements not talloc safe */
        if (!pl->tree) {
                fr_packet_list_free(pl);
                return NULL;
@@ -301,14 +301,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,
-                           fr_radius_packet_t *request)
+                           fr_packet_t *request)
 {
        if (!pl || !request) return 0;
 
        return fr_rb_insert(pl->tree, request);
 }
 
-fr_radius_packet_t *fr_packet_list_find(fr_packet_list_t *pl, fr_radius_packet_t *request)
+fr_packet_t *fr_packet_list_find(fr_packet_list_t *pl, fr_packet_t *request)
 {
        if (!pl || !request) return 0;
 
@@ -320,9 +320,9 @@ fr_radius_packet_t *fr_packet_list_find(fr_packet_list_t *pl, fr_radius_packet_t
  *     This presumes that the reply has dst_ipaddr && dst_port set up
  *     correctly (i.e. real IP, or "*").
  */
-fr_radius_packet_t *fr_packet_list_find_byreply(fr_packet_list_t *pl, fr_radius_packet_t *reply)
+fr_packet_t *fr_packet_list_find_byreply(fr_packet_list_t *pl, fr_packet_t *reply)
 {
-       fr_radius_packet_t my_request, *request;
+       fr_packet_t my_request, *request;
        fr_packet_socket_t *ps;
 
        if (!pl || !reply) return NULL;
@@ -358,7 +358,7 @@ fr_radius_packet_t *fr_packet_list_find_byreply(fr_packet_list_t *pl, fr_radius_
 }
 
 
-bool fr_packet_list_yank(fr_packet_list_t *pl, fr_radius_packet_t *request)
+bool fr_packet_list_yank(fr_packet_list_t *pl, fr_packet_t *request)
 {
        if (!pl || !request) return false;
 
@@ -393,7 +393,7 @@ 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,
-                           fr_radius_packet_t *request, void **pctx)
+                           fr_packet_t *request, void **pctx)
 {
        int i, j, k, fd, id, start_i, start_j, start_k;
        int src_any = 0;
@@ -619,7 +619,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,
-                           fr_radius_packet_t *request, bool yank)
+                           fr_packet_t *request, bool yank)
 {
        fr_packet_socket_t *ps;
 
@@ -669,10 +669,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.
  */
-fr_radius_packet_t *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma)
+fr_packet_t *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma)
 {
        int start;
-       fr_radius_packet_t *packet;
+       fr_packet_t *packet;
 
        if (!pl || !set) return NULL;
 
@@ -727,7 +727,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, fr_radius_packet_t *packet, bool received)
+void fr_packet_header_log(fr_log_t const *log, fr_packet_t *packet, bool received)
 {
        char src_ipaddr[FR_IPADDR_STRLEN];
        char dst_ipaddr[FR_IPADDR_STRLEN];
@@ -798,7 +798,7 @@ void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool
 /*
  *     Debug the packet header and all attributes
  */
-void fr_packet_log(fr_log_t const *log, fr_radius_packet_t *packet, fr_pair_list_t *list, bool received)
+void fr_packet_log(fr_log_t const *log, fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
        fr_packet_header_log(log, packet, received);
        if (fr_debug_lvl >= L_DBG_LVL_1) fr_pair_list_log(log, 4, list);
index a3216b0fd6db5a42123b2144bbd4cef108c7914f..10a3582415d70cbbc43c678375a2838bd6cfa1c9 100644 (file)
@@ -30,24 +30,24 @@ RCSIDH(list_h, "$Id$")
 #include <stdint.h>
 
 int8_t fr_packet_cmp(void const *a, void const *b);
-void fr_request_from_reply(fr_radius_packet_t *request,
-                            fr_radius_packet_t const *reply);
+void fr_request_from_reply(fr_packet_t *request,
+                            fr_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, fr_radius_packet_t *request_p);
+bool fr_packet_list_insert(fr_packet_list_t *pl, fr_packet_t *request_p);
 
-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);
+fr_packet_t *fr_packet_list_find(fr_packet_list_t *pl, fr_packet_t *request);
+fr_packet_t *fr_packet_list_find_byreply(fr_packet_list_t *pl, fr_packet_t *reply);
 bool fr_packet_list_yank(fr_packet_list_t *pl,
-                        fr_radius_packet_t *request);
+                        fr_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,
-                           fr_radius_packet_t *request_p, void **pctx);
+                           fr_packet_t *request_p, void **pctx);
 bool fr_packet_list_id_free(fr_packet_list_t *pl,
-                           fr_radius_packet_t *request, bool yank);
+                           fr_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);
@@ -55,10 +55,10 @@ bool fr_packet_list_socket_del(fr_packet_list_t *pl, int sockfd);
 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_fd_set(fr_packet_list_t *pl, fd_set *set);
-fr_radius_packet_t *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma);
+fr_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, fr_radius_packet_t *packet, bool received);
-void fr_packet_log(fr_log_t const *log, fr_radius_packet_t *packet, fr_pair_list_t *list, bool received);
+void fr_packet_header_log(fr_log_t const *log, fr_packet_t *packet, bool received);
+void fr_packet_log(fr_log_t const *log, fr_packet_t *packet, fr_pair_list_t *list, bool received);
index 9390e3ab0d33f8341b1998f75c44b72d58745c76..a9a76c209253bcc5e1852502b338e9d24e9ca41a 100644 (file)
@@ -18,7 +18,7 @@
  * $Id$
  *
  * @file protocols/radius/packet.c
- * @brief Functions to deal with fr_radius_packet_t data structures.
+ * @brief Functions to deal with fr_packet_t data structures.
  *
  * @copyright 2000-2017 The FreeRADIUS server project
  */
@@ -49,8 +49,8 @@ typedef struct {
 /** Encode a packet
  *
  */
-ssize_t fr_radius_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list,
-                               fr_radius_packet_t const *original, char const *secret)
+ssize_t fr_radius_packet_encode(fr_packet_t *packet, fr_pair_list_t *list,
+                               fr_packet_t const *original, char const *secret)
 {
        uint8_t const *original_data;
        ssize_t slen;
@@ -112,7 +112,7 @@ ssize_t fr_radius_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list
  *     - True on success.
  *     - False on failure.
  */
-bool fr_radius_packet_ok(fr_radius_packet_t *packet, uint32_t max_attributes, bool require_ma, decode_fail_t *reason)
+bool fr_radius_packet_ok(fr_packet_t *packet, uint32_t max_attributes, bool require_ma, decode_fail_t *reason)
 {
        char host_ipaddr[INET6_ADDRSTRLEN];
 
@@ -136,8 +136,8 @@ bool fr_radius_packet_ok(fr_radius_packet_t *packet, uint32_t max_attributes, bo
 /** Verify the Request/Response Authenticator (and Message-Authenticator if present) of a packet
  *
  */
-int fr_radius_packet_verify(fr_radius_packet_t *packet, fr_radius_packet_t *original, char const *secret)
-{      
+int fr_radius_packet_verify(fr_packet_t *packet, fr_packet_t *original, char const *secret)
+{
        char            buffer[INET6_ADDRSTRLEN];
 
        if (!packet->data) return -1;
@@ -157,7 +157,7 @@ int fr_radius_packet_verify(fr_radius_packet_t *packet, fr_radius_packet_t *orig
 /** Sign a previously encoded packet
  *
  */
-int fr_radius_packet_sign(fr_radius_packet_t *packet, fr_radius_packet_t const *original,
+int fr_radius_packet_sign(fr_packet_t *packet, fr_packet_t const *original,
                          char const *secret)
 {
        int ret;
@@ -184,7 +184,7 @@ int fr_radius_packet_sign(fr_radius_packet_t *packet, fr_radius_packet_t const *
 /** Wrapper for recvfrom, which handles recvfromto, IPv6, and all possible combinations
  *
  */
-static ssize_t rad_recvfrom(int sockfd, fr_radius_packet_t *packet, int flags)
+static ssize_t rad_recvfrom(int sockfd, fr_packet_t *packet, int flags)
 {
        ssize_t                 data_len;
 
@@ -205,13 +205,13 @@ static ssize_t rad_recvfrom(int sockfd, fr_radius_packet_t *packet, int flags)
 }
 
 
-/** Receive UDP client requests, and fill in the basics of a fr_radius_packet_t structure
+/** Receive UDP client requests, and fill in the basics of a fr_packet_t structure
  *
  */
-fr_radius_packet_t *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, uint32_t max_attributes, bool require_ma)
+fr_packet_t *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, uint32_t max_attributes, bool require_ma)
 {
        ssize_t                 data_len;
-       fr_radius_packet_t      *packet;
+       fr_packet_t     *packet;
 
        /*
         *      Allocate the new request data structure
@@ -294,8 +294,8 @@ fr_radius_packet_t *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, ui
  *
  * Also attach reply attribute value pairs and any user message provided.
  */
-int fr_radius_packet_send(fr_radius_packet_t *packet, fr_pair_list_t *list,
-                         fr_radius_packet_t const *original, char const *secret)
+int fr_radius_packet_send(fr_packet_t *packet, fr_pair_list_t *list,
+                         fr_packet_t const *original, char const *secret)
 {
        /*
         *      Maybe it's a fake packet.  Don't send it.
@@ -352,7 +352,7 @@ int fr_radius_packet_send(fr_radius_packet_t *packet, fr_pair_list_t *list,
        return udp_send(&packet->socket, 0, packet->data, packet->data_len);
 }
 
-void _fr_radius_packet_log_hex(fr_log_t const *log, fr_radius_packet_t const *packet, char const *file, int line)
+void _fr_radius_packet_log_hex(fr_log_t const *log, fr_packet_t const *packet, char const *file, int line)
 {
        uint8_t const *attr, *end;
        char buffer[1024];
index 0e7f3168618162db692c9abfa7807f99a6764ed6..6ab24ea3a146b79166672e6ed1d72ae48b6d0704 100644 (file)
@@ -188,24 +188,24 @@ void              fr_radius_global_free(void);
 /*
  *     protocols/radius/packet.c
  */
-ssize_t                fr_radius_packet_encode(fr_radius_packet_t *packet, fr_pair_list_t *list,
-                                       fr_radius_packet_t const *original,
+ssize_t                fr_radius_packet_encode(fr_packet_t *packet, fr_pair_list_t *list,
+                                       fr_packet_t const *original,
                                        char const *secret) CC_HINT(nonnull (1,2,4));
 
-bool           fr_radius_packet_ok(fr_radius_packet_t *packet, uint32_t max_attributes, bool require_ma,
+bool           fr_radius_packet_ok(fr_packet_t *packet, uint32_t max_attributes, bool require_ma,
                                    decode_fail_t *reason) CC_HINT(nonnull (1));
 
-int            fr_radius_packet_verify(fr_radius_packet_t *packet, fr_radius_packet_t *original,
+int            fr_radius_packet_verify(fr_packet_t *packet, fr_packet_t *original,
                                        char const *secret) CC_HINT(nonnull (1,3));
-int            fr_radius_packet_sign(fr_radius_packet_t *packet, fr_radius_packet_t const *original,
+int            fr_radius_packet_sign(fr_packet_t *packet, fr_packet_t const *original,
                                      char const *secret) CC_HINT(nonnull (1,3));
 
-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_pair_list_t *list,
-                                     fr_radius_packet_t const *original, char const *secret) CC_HINT(nonnull (1,2,4));
+fr_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_packet_t *packet, fr_pair_list_t *list,
+                                     fr_packet_t const *original, char const *secret) CC_HINT(nonnull (1,2,4));
 
 #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, fr_radius_packet_t const *packet, char const *file, int line) CC_HINT(nonnull);
+void           _fr_radius_packet_log_hex(fr_log_t const *log, fr_packet_t const *packet, char const *file, int line) CC_HINT(nonnull);
 
 /*
  *     protocols/radius/abinary.c
index 74eea4a40ffd1aab2c1e0ff99aa635717b644205..bbcff289a19d755e5e17fe680dc1be04d413b5b1 100644 (file)
@@ -28,9 +28,9 @@ RCSID("$Id$")
 #include <freeradius-devel/util/syserror.h>
 #include "tcp.h"
 
-fr_radius_packet_t *fr_tcp_recv(int sockfd, int flags)
+fr_packet_t *fr_tcp_recv(int sockfd, int flags)
 {
-       fr_radius_packet_t *packet = fr_radius_packet_alloc(NULL, false);
+       fr_packet_t *packet = fr_radius_packet_alloc(NULL, false);
 
        if (!packet) return NULL;
 
@@ -45,7 +45,7 @@ fr_radius_packet_t *fr_tcp_recv(int sockfd, int flags)
 }
 
 /*
- *     Receives a packet, assuming that the fr_radius_packet_t structure
+ *     Receives a packet, assuming that the fr_packet_t structure
  *     has been filled out already.
  *
  *     This ASSUMES that the packet is allocated && fields
@@ -57,7 +57,7 @@ fr_radius_packet_t *fr_tcp_recv(int sockfd, int flags)
  *     Calling this function MAY change sockfd,
  *     if src_ipaddr.af == AF_UNSPEC.
  */
-int fr_tcp_read_packet(fr_radius_packet_t *packet, uint32_t max_attributes, bool require_ma)
+int fr_tcp_read_packet(fr_packet_t *packet, uint32_t max_attributes, bool require_ma)
 {
        ssize_t len;
 
index 08673e3078a34db24ee366922d3677b601c0600a..7e7ab6d7540bf7aac904235231d57de2a3911365 100644 (file)
@@ -25,5 +25,5 @@
  */
 RCSIDH(tcp_h, "$Id$")
 
-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);
+int fr_tcp_read_packet(fr_packet_t *packet, uint32_t max_attributes, bool require_ma);
+fr_packet_t *fr_tcp_recv(int sockfd, int flags);