c83f6543aa42ecd0f3c6a579b94385ccde55c642
* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
static char sccsid
[] = "@(#)byteorder.c 2.5 (Berkeley) %G%";
#include <protocols/timed.h>
* Two routines to do the necessary byte swapping for timed protocol
* messages. Protocol is defined in /usr/include/protocols/timed.h
ptr
->tsp_seq
= htons((u_short
)ptr
->tsp_seq
);
ptr
->tsp_time
.tv_sec
= htonl((u_long
)ptr
->tsp_time
.tv_sec
);
ptr
->tsp_time
.tv_usec
= htonl((u_long
)ptr
->tsp_time
.tv_usec
);
break; /* nothing more needed */
ptr
->tsp_seq
= ntohs((u_short
)ptr
->tsp_seq
);
ptr
->tsp_time
.tv_sec
= ntohl((u_long
)ptr
->tsp_time
.tv_sec
);
ptr
->tsp_time
.tv_usec
= ntohl((u_long
)ptr
->tsp_time
.tv_usec
);
break; /* nothing more needed */