[Click] SO_TIMESTAMP

Eddie Kohler kohler at cs.ucla.edu
Sun Sep 16 13:16:10 EDT 2007


Bob,

I just applied this patch, which should help.

Eddie

diff --git a/elements/userlevel/socket.cc b/elements/userlevel/socket.cc
index a386f84..40784f3 100644
--- a/elements/userlevel/socket.cc
+++ b/elements/userlevel/socket.cc
@@ -4,7 +4,7 @@
   * Mark Huang <mlhuang at cs.princeton.edu>
   *
   * Copyright (c) 2004  The Trustees of Princeton University (Trustees).
- * Copyright (c) 2006 Regents of the University of California
+ * Copyright (c) 2006-2007 Regents of the University of California
   *
   * Permission is hereby granted, free of charge, to any person obtaining a
   * copy of this software and associated documentation files (the "Software"),
@@ -180,9 +180,13 @@ Socket::initialize(ErrorHandler *errh)

    // enable timestamps
    if (_timestamp) {
+#ifdef SO_TIMESTAMP
      int one = 1;
      if (setsockopt(_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)) < 0)
        return initialize_socket_error(errh, "setsockopt(SO_TIMESTAMP)");
+#else
+    return initialize_socket_error(errh, "TIMESTAMP not supported on this 
platform");
+#endif
    }

  #ifdef TCP_NODELAY


Bob Keyes wrote:
> Hi all,
> I am trying to compile userlevel Click on OpenBSD 4.1, using GCC 4.2. It
> fails trying at socket.cc:
> 
>  CXX ../elements/userlevel/socket.cc
> ../elements/userlevel/socket.cc: In member function 'virtual int
> Socket::initialize(ErrorHandler*)':
> ../elements/userlevel/socket.cc:184: error: 'SO_TIMESTAMP' was not
> declared in this scope
> gmake: *** [socket.o] Error 1
> *** Error code 2
> 
> Stop in /home/bob/click (line 53 of Makefile).
> 
> 
> 
> This is because BSD doesn't have a TIMESTAMP Socket Option. What is the
> canonical way of getting around this. Also, any other hints regarding
> roadblocks I might encounter and how to get around them would be
> appreciated.
> 
> Regards,
> Bob Keyes
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list