summaryrefslogtreecommitdiff
path: root/lib/include
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-07 15:23:40 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-07 15:23:40 +0100
commitcbcaa6a7c8f8a6704f6b4a68f260020957214a07 (patch)
tree1d0bc882bfd69f490562daa829a7a8845ecf4552 /lib/include
parent41af6cd03dac4eb905d0d3de574d2e4f3f9600eb (diff)
Move verification of response packets up to a level where it makes sense.
Replace the user_dispatch_flag on connections with conn_user_dispatch_p(). Remove the 'original' member from packet and instead have an upper layer verify. Rename packet valid_flag --> received_flag to reflect that we don't verify. Move _close_conn() --> conn_close(). Move packet flags into a single unsigned int, for portability. (_read_packet): Don't verify packet. (rs_conn_receive_packet): Don't touch PKT_OUT if there isn't a packet. (rs_conn_receive_packet): Verify packet using packet_verify_response().
Diffstat (limited to 'lib/include')
-rw-r--r--lib/include/radsec/radsec-impl.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/include/radsec/radsec-impl.h b/lib/include/radsec/radsec-impl.h
index f8904ac..e790ccf 100644
--- a/lib/include/radsec/radsec-impl.h
+++ b/lib/include/radsec/radsec-impl.h
@@ -81,7 +81,6 @@ struct rs_connection {
int fd; /* Socket. */
int tryagain; /* For server failover. */
int nextid; /* Next RADIUS packet identifier. */
- int user_dispatch_flag : 1; /* User does the dispatching. */
/* TCP transport specifics. */
struct bufferevent *bev; /* Buffer event. */
/* UDP transport specifics. */
@@ -95,14 +94,17 @@ struct rs_connection {
#endif
};
+enum rs_packet_flags {
+ rs_packet_hdr_read_flag,
+ rs_packet_received_flag,
+ rs_packet_sent_flag,
+};
+
struct rs_packet {
struct rs_connection *conn;
- char hdr_read_flag;
- uint8_t hdr[4];
+ unsigned int flags;
+ uint8_t hdr[RS_HEADER_LEN];
RADIUS_PACKET *rpkt;
- struct rs_packet *original;
- char valid_flag;
- char written_flag;
struct rs_packet *next; /* Used for UDP output queue. */
};