Revision: 14309
Author: adrian.chadd
Date: Wed Sep 30 00:25:34 2009
Log: Add a small comm function which returns the -socket- TOS at the moment,
rather than F->tos. I'll flesh this out into a proper API for getting
and setting the current socket TOS later on when I decide exactly
what to do with it.


http://code.google.com/p/lusca-cache/source/detail?r=14309

Modified:
  /branches/LUSCA_HEAD/libiapp/comm.c
  /branches/LUSCA_HEAD/libiapp/comm.h

=======================================
--- /branches/LUSCA_HEAD/libiapp/comm.c Mon Jun 29 22:00:22 2009
+++ /branches/LUSCA_HEAD/libiapp/comm.c Wed Sep 30 00:25:34 2009
@@ -1173,6 +1173,24 @@
      if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on))  
< 0)
        debug(5, 1) ("commSetTcpKeepalive: FD %d: %s\n", fd, xstrerror());
  }
+
+int
+commGetSocketTos(int fd)
+{
+       int res;
+       int tos;
+       socklen_t len;
+
+       len = sizeof(tos);
+
+#ifdef IP_TOS
+       res = getsockopt(fd, IPPROTO_IP, IP_TOS, &tos, &len);
+#else
+       errno = ENOSYS;
+       tos = -1;
+#endif
+       return tos;
+}

  int
  commSetTos(int fd, int tos)
=======================================
--- /branches/LUSCA_HEAD/libiapp/comm.h Sun Jun 14 06:30:02 2009
+++ /branches/LUSCA_HEAD/libiapp/comm.h Wed Sep 30 00:25:34 2009
@@ -182,6 +182,7 @@
  extern void commSetCloseOnExec(int fd);
  extern int commSetTcpBufferSize(int fd, int buffer_size);
  extern void commSetTcpKeepalive(int fd, int idle, int interval, int  
timeout);
+extern int commGetSocketTos(int fd);
  extern int commSetTos(int fd, int tos);
  extern int commSetSocketPriority(int fd, int prio);
  extern int commSetIPOption(int fd, uint8_t option, void *value, size_t  
size);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to