-#define fxdr_time(f, t) {((struct timeval *)(t))->tv_sec=ntohl( \
- ((struct timeval *)(f))->tv_sec); \
- ((struct timeval *)(t))->tv_usec=ntohl( \
- ((struct timeval *)(f))->tv_usec);}
+#define fxdr_nfstime(f, t) { \
+ (t)->ts_sec = \
+ ntohl(((struct nfsv2_time *)(f))->nfs_sec); \
+ (t)->ts_nsec = 1000 * \
+ ntohl(((struct nfsv2_time *)(f))->nfs_usec); \
+}
+
+#define fxdr_nqtime(f, t) { \
+ (t)->ts_sec = \
+ ntohl(((struct nqnfs_time *)(f))->nq_sec); \
+ (t)->ts_nsec = \
+ ntohl(((struct nqnfs_time *)(f))->nq_nsec); \
+}
+
+/*
+ * To handle quad conversions, define a struct of two longs and use
+ * ntohl and htonl. Maybe someday there should be ntohq and htonq?
+ */
+union _hq {
+ quad_t hq;
+ struct {
+ long val[2];
+ } lq;
+};
+#define fxdr_hyper(f, t) { \
+ ((union _hq *)(t))->lq.val[1] = ntohl(((union _hq *)(f))->lq.val[0]); \
+ ((union _hq *)(t))->lq.val[0] = ntohl(((union _hq *)(f))->lq.val[1]); \
+}
+#define txdr_hyper(f, t) { \
+ ((union _hq *)(t))->lq.val[0] = htonl(((union _hq *)(f))->lq.val[1]); \
+ ((union _hq *)(t))->lq.val[1] = htonl(((union _hq *)(f))->lq.val[0]); \
+}