summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2013-01-24 08:32:23 +0100
committerLinus Nordberg <linus@nordberg.se>2013-01-24 09:30:02 +0100
commit683e3e1bbbdfe2f08dc12f1e840e71ed6088a0e3 (patch)
tree73e26b7fe3cd2231f9a82fa1a10fe3c196ce8585
parent54ca8b0dc915b6fac25de9d7cdaf6154dbbb27da (diff)
Rename rs_packet_flags members.
Uppercase to make them appear as the constants they are, as opposed to variables. Remove 'flag' suffix, typically used for variables. Spell out HEADER.
-rw-r--r--lib/conn.c6
-rw-r--r--lib/include/radsec/radsec-impl.h6
-rw-r--r--lib/send.c4
-rw-r--r--lib/tcp.c6
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/conn.c b/lib/conn.c
index c6692a2..09a1ac0 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -207,7 +207,7 @@ _rcb (struct rs_packet *packet, void *user_data)
assert (pkt);
assert (pkt->conn);
- pkt->flags |= rs_packet_received_flag;
+ pkt->flags |= RS_PACKET_RECEIVED;
if (pkt->conn->bev)
bufferevent_disable (pkt->conn->bev, EV_WRITE|EV_READ);
else
@@ -234,7 +234,7 @@ rs_conn_receive_packet (struct rs_connection *conn,
conn->callbacks.received_cb = _rcb;
conn->user_data = pkt;
- pkt->flags &= ~rs_packet_received_flag;
+ pkt->flags &= ~RS_PACKET_RECEIVED;
if (conn->bev) /* TCP. */
{
@@ -267,7 +267,7 @@ rs_conn_receive_packet (struct rs_connection *conn,
evutil_gai_strerror (err));
rs_debug (("%s: event loop done\n", __func__));
- if ((pkt->flags & rs_packet_received_flag) == 0
+ if ((pkt->flags & RS_PACKET_RECEIVED) == 0
|| (req_msg
&& packet_verify_response (pkt->conn, pkt, req_msg) != RSE_OK))
{
diff --git a/lib/include/radsec/radsec-impl.h b/lib/include/radsec/radsec-impl.h
index a4d97f0..6c02dcf 100644
--- a/lib/include/radsec/radsec-impl.h
+++ b/lib/include/radsec/radsec-impl.h
@@ -116,9 +116,9 @@ struct rs_connection {
};
enum rs_packet_flags {
- rs_packet_hdr_read_flag,
- rs_packet_received_flag,
- rs_packet_sent_flag,
+ RS_PACKET_HEADER_READ,
+ RS_PACKET_RECEIVED,
+ RS_PACKET_SENT,
};
struct radius_packet;
diff --git a/lib/send.c b/lib/send.c
index 6b887c5..e58b42c 100644
--- a/lib/send.c
+++ b/lib/send.c
@@ -67,7 +67,7 @@ _wcb (void *user_data)
{
struct rs_packet *pkt = (struct rs_packet *) user_data;
assert (pkt);
- pkt->flags |= rs_packet_sent_flag;
+ pkt->flags |= RS_PACKET_SENT;
if (pkt->conn->bev)
bufferevent_disable (pkt->conn->bev, EV_WRITE|EV_READ);
else
@@ -127,7 +127,7 @@ rs_packet_send (struct rs_packet *pkt, void *user_data)
conn->callbacks.sent_cb = NULL;
conn->user_data = NULL;
- if ((pkt->flags & rs_packet_sent_flag) == 0)
+ if ((pkt->flags & RS_PACKET_SENT) == 0)
{
assert (rs_err_conn_peek_code (conn));
return rs_err_conn_peek_code (conn);
diff --git a/lib/tcp.c b/lib/tcp.c
index 588d046..e2e9feb 100644
--- a/lib/tcp.c
+++ b/lib/tcp.c
@@ -34,7 +34,7 @@ _read_header (struct rs_packet *pkt)
n = bufferevent_read (pkt->conn->bev, pkt->hdr, RS_HEADER_LEN);
if (n == RS_HEADER_LEN)
{
- pkt->flags |= rs_packet_hdr_read_flag;
+ pkt->flags |= RS_PACKET_HEADER_READ;
pkt->rpkt->length = (pkt->hdr[2] << 8) + pkt->hdr[3];
if (pkt->rpkt->length < 20 || pkt->rpkt->length > RS_MAX_PACKET_LEN)
{
@@ -89,7 +89,7 @@ _read_packet (struct rs_packet *pkt)
{
bufferevent_disable (pkt->conn->bev, EV_READ);
rs_debug (("%s: complete packet read\n", __func__));
- pkt->flags &= ~rs_packet_hdr_read_flag;
+ pkt->flags &= ~RS_PACKET_HEADER_READ;
memset (pkt->hdr, 0, sizeof(*pkt->hdr));
/* Checks done by rad_packet_ok:
@@ -155,7 +155,7 @@ tcp_read_cb (struct bufferevent *bev, void *user_data)
Room for improvement: Peek inside buffer (evbuffer_copyout()) to
avoid the extra copying. */
- if ((pkt->flags & rs_packet_hdr_read_flag) == 0)
+ if ((pkt->flags & RS_PACKET_HEADER_READ) == 0)
if (_read_header (pkt))
return; /* Error. */
_read_packet (pkt);