Enumerate the event codes for the transport layer transmission methods.

We add a new event code that indicates a one step event message.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-11-30 10:06:07 +01:00
parent 4ef70c3d2e
commit 24385005b8
4 changed files with 13 additions and 3 deletions

2
raw.c
View File

@ -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)

View File

@ -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,

2
udp.c
View File

@ -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)

2
udp6.c
View File

@ -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)