Skip to content

Commit

Permalink
Enumerate the event codes for the transport layer transmission methods.
Browse files Browse the repository at this point in the history
We add a new event code that indicates a one step event message.

Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Nov 30, 2012
1 parent 4ef70c3 commit 2438500
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int raw_send(struct transport *t, struct fdarray *fda, int event, int pee
/*
* Get the time stamp right away.
*/
return event ? sk_receive(fd, pkt, len, hwts, MSG_ERRQUEUE) : cnt;
return event == TRANS_EVENT ? sk_receive(fd, pkt, len, hwts, MSG_ERRQUEUE) : cnt;
}

static void raw_release(struct transport *t)
Expand Down
10 changes: 10 additions & 0 deletions transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ enum transport_type {
TRANS_UDS,
};

/**
* Values for the 'event' parameter in transport_send() and
* transport_peer().
*/
enum transport_event {
TRANS_GENERAL,
TRANS_EVENT,
TRANS_ONESTEP,
};

enum timestamp_type {
TS_SOFTWARE,
TS_HARDWARE,
Expand Down
2 changes: 1 addition & 1 deletion udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static int udp_send(struct transport *t, struct fdarray *fda, int event, int pee
/*
* Get the time stamp right away.
*/
return event ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt;
return event == TRANS_EVENT ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt;
}

static void udp_release(struct transport *t)
Expand Down
2 changes: 1 addition & 1 deletion udp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static int udp6_send(struct transport *t, struct fdarray *fda, int event, int pe
/*
* Get the time stamp right away.
*/
return event ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt;
return event == TRANS_EVENT ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt;
}

static void udp6_release(struct transport *t)
Expand Down

0 comments on commit 2438500

Please sign in to comment.