Pass transport type to time stamping initialization function.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Jiri Benc <jbenc@redhat.com>
master
Richard Cochran 2012-10-25 15:19:31 +02:00
parent 7894339cdd
commit 8dde0d31b6
5 changed files with 12 additions and 9 deletions

2
raw.c
View File

@ -206,7 +206,7 @@ static int raw_open(struct transport *t, char *name,
if (gfd < 0)
goto no_general;
if (sk_timestamping_init(efd, name, ts_type))
if (sk_timestamping_init(efd, name, ts_type, TRANS_IEEE_802_3))
goto no_timestamping;
fda->fd[FD_EVENT] = efd;

3
sk.c
View File

@ -223,7 +223,8 @@ int sk_receive(int fd, void *buf, int buflen,
return cnt;
}
int sk_timestamping_init(int fd, char *device, enum timestamp_type type)
int sk_timestamping_init(int fd, char *device, enum timestamp_type type,
enum transport_type transport)
{
int flags;

12
sk.h
View File

@ -61,12 +61,14 @@ int sk_receive(int fd, void *buf, int buflen,
/**
* Enable time stamping on a given network interface.
* @param fd An open socket.
* @param device The name of the network interface to configure.
* @param type The requested flavor of time stamping.
* @return Zero on success, non-zero otherwise.
* @param fd An open socket.
* @param device The name of the network interface to configure.
* @param type The requested flavor of time stamping.
* @param transport The type of transport used.
* @return Zero on success, non-zero otherwise.
*/
int sk_timestamping_init(int fd, char *device, enum timestamp_type type);
int sk_timestamping_init(int fd, char *device, enum timestamp_type type,
enum transport_type transport);
/**
* Limits the number of RECVMSG(2) calls when attempting to obtain a

2
udp.c
View File

@ -155,7 +155,7 @@ static int udp_open(struct transport *t, char *name, struct fdarray *fda,
if (gfd < 0)
goto no_general;
if (sk_timestamping_init(efd, name, ts_type))
if (sk_timestamping_init(efd, name, ts_type, TRANS_UDP_IPV4))
goto no_timestamping;
fda->fd[FD_EVENT] = efd;

2
udp6.c
View File

@ -154,7 +154,7 @@ static int udp6_open(struct transport *t, char *name, struct fdarray *fda,
if (gfd < 0)
goto no_general;
if (sk_timestamping_init(efd, name, ts_type))
if (sk_timestamping_init(efd, name, ts_type, TRANS_UDP_IPV6))
goto no_timestamping;
fda->fd[FD_EVENT] = efd;