]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Move RADIUS_PACKET into packet.h
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 8 May 2017 19:38:45 +0000 (15:38 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 8 May 2017 19:41:09 +0000 (15:41 -0400)
src/include/libradius.h
src/include/packet.h

index 9cbd368ce5659ce6932d2200cfee6ef4a5e72a0c..38fec3b4decddafbf6f4c1ec485869859318cf53 100644 (file)
@@ -117,43 +117,6 @@ typedef void (*sig_t)(int);
 #  define DEBUG                        if (fr_debug_lvl && fr_log_fp) fr_printf_log
 #endif
 
-/*
- *     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
- *
- *     verified:       Filled in by rad_decode for accounting-request packets
- *
- *     data,data_len:  Used between fr_radius_recv and fr_radius_decode.
- */
-typedef struct radius_packet {
-       int                     sockfd;                 //!< Socket this packet was read from.
-       int                     if_index;               //!< Index of receiving interface.
-       fr_ipaddr_t             src_ipaddr;             //!< Src IP address of packet.
-       fr_ipaddr_t             dst_ipaddr;             //!< Dst IP address of packet.
-       uint16_t                src_port;               //!< Src port of packet.
-       uint16_t                dst_port;               //!< DST Port of packet.
-
-       int                     id;                     //!< Packet ID (used to link requests/responses).
-       unsigned int            code;                   //!< Packet code (type).
-
-       uint8_t                 vector[AUTH_VECTOR_LEN];//!< RADIUS authentication vector.
-
-       uint32_t                count;                  //!< Number of times we've seen this packet
-       struct timeval          timestamp;              //!< When we received the packet.
-       uint8_t                 *data;                  //!< Packet data (body).
-       size_t                  data_len;               //!< Length of packet data.
-       VALUE_PAIR              *vps;                   //!< Result of decoding the packet into VALUE_PAIRs.
-       ssize_t                 offset;
-
-       uint32_t                rounds;                 //!< for State[0]
-
-#ifdef WITH_TCP
-       size_t                  partial;
-       int                     proto;
-#endif
-} RADIUS_PACKET;
-
 typedef enum {
        DECODE_FAIL_NONE = 0,
        DECODE_FAIL_MIN_LENGTH_PACKET,
index b587e76c50db734d843146e99f56c453c3d1a79c..ccc68c9dfd40f66a6d8186b0f0a3688a4dbeb2d8 100644 (file)
@@ -29,6 +29,49 @@ RCSIDH(packet_h, "$Id$")
 extern "C" {
 #endif
 
+#include <freeradius-devel/inet.h>
+#include <freeradius-devel/pair.h>
+#include <freeradius-devel/rbtree.h>
+
+#define AUTH_VECTOR_LEN                16
+
+/*
+ *     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
+ *
+ *     verified:       Filled in by rad_decode for accounting-request packets
+ *
+ *     data,data_len:  Used between fr_radius_recv and fr_radius_decode.
+ */
+typedef struct radius_packet {
+       int                     sockfd;                 //!< Socket this packet was read from.
+       int                     if_index;               //!< Index of receiving interface.
+       fr_ipaddr_t             src_ipaddr;             //!< Src IP address of packet.
+       fr_ipaddr_t             dst_ipaddr;             //!< Dst IP address of packet.
+       uint16_t                src_port;               //!< Src port of packet.
+       uint16_t                dst_port;               //!< DST Port of packet.
+
+       int                     id;                     //!< Packet ID (used to link requests/responses).
+       unsigned int            code;                   //!< Packet code (type).
+
+       uint8_t                 vector[AUTH_VECTOR_LEN];//!< RADIUS authentication vector.
+
+       uint32_t                count;                  //!< Number of times we've seen this packet
+       struct timeval          timestamp;              //!< When we received the packet.
+       uint8_t                 *data;                  //!< Packet data (body).
+       size_t                  data_len;               //!< Length of packet data.
+       VALUE_PAIR              *vps;                   //!< Result of decoding the packet into VALUE_PAIRs.
+       ssize_t                 offset;
+
+       uint32_t                rounds;                 //!< for State[0]
+
+#ifdef WITH_TCP
+       size_t                  partial;
+       int                     proto;
+#endif
+} RADIUS_PACKET;
+
 int fr_packet_cmp(RADIUS_PACKET const *a, RADIUS_PACKET const *b);
 void fr_request_from_reply(RADIUS_PACKET *request,
                             RADIUS_PACKET const *reply);