[Sumover-dev] [svn commit] r4675 - vic/branches/cc/net
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Fri Mar 5 20:09:59 GMT 2010
Author: soohyunc
Date: Fri Mar 5 20:09:59 2010
New Revision: 4675
Modified:
vic/branches/cc/net/net.h
Log:
-- variables and funtions declaration for IP_TOS and SO_TIMESTAMP
(these are socket options)
Modified: vic/branches/cc/net/net.h
==============================================================================
--- vic/branches/cc/net/net.h (original)
+++ vic/branches/cc/net/net.h Fri Mar 5 20:09:59 2010
@@ -37,6 +37,7 @@
#ifndef vic_net_h
#define vic_net_h
+#include <sys/time.h>
#include "inet.h"
#include "vic_tcl.h"
@@ -90,13 +91,19 @@
inline const Address & interface() const { return (local_); }
inline int port() const { return (port_); }
inline int ttl() const { return (ttl_); }
- inline u_int8_t recv_tos() const { return (recv_tos_); }
inline int noloopback_broken() const { return (noloopback_broken_); }
virtual void reset();
static void nonblock(int fd);
inline Crypt* crypt() const { return (crypt_); }
virtual Address* alloc(const char* name) { UNUSED(name); return (0);}
+ // IP_TOS
+ inline u_int8_t recv_tos() const { return (recv_tos_); }
+ // SO_TIMESTAMP
+ inline double recv_so_time() const {
+ return ((double) tvrecv.tv_sec + 1e-6 * (double) tvrecv.tv_usec);
+ }
+
protected:
virtual void dosend(u_char* buf, int len, int fd);
virtual int dorecv(u_char* buf, int len, u_int32_t& from, int fd);
@@ -111,9 +118,16 @@
int rsock_;
int ssock_;
+ // IP_TOS--------------
u_int8_t recv_tos_;
int noloopback_broken_;
-
+ //---------------------
+
+ // SO_TIMESTAMP--------
+ struct timeval tvrecv;
+ int tvlen;
+ //---------------------
+
Crypt* crypt_;
static u_char* wrkbuf_;
@@ -121,6 +135,4 @@
static void expand_wrkbuf(int len);
static int cpmsg(const msghdr& mh);
};
-
-
#endif
More information about the Sumover-dev
mailing list