[netperf-dev] netperf2 commit notice r94 - trunk/src

raj at netperf.org raj at netperf.org
Tue Feb 13 12:50:01 PST 2007


Author: raj
Date: 2007-02-13 12:50:00 -0800 (Tue, 13 Feb 2007)
New Revision: 94

Modified:
   trunk/src/netlib.c
   trunk/src/netlib.h
Log:
kludge around a name pollution problem in AIX include files

Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c	2007-02-13 01:17:53 UTC (rev 93)
+++ trunk/src/netlib.c	2007-02-13 20:50:00 UTC (rev 94)
@@ -3467,7 +3467,7 @@
 }
 
 int
-dl_connect(int fd, unsigned char *rem_addr, int rem_addr_len)
+dl_connect(int fd, unsigned char *remote_addr, int remote_addr_len)
 {
   dl_connect_req_t *connection_req = (dl_connect_req_t *)control_data;
   dl_connect_con_t *connection_con = (dl_connect_con_t *)control_data;
@@ -3486,19 +3486,19 @@
   data_message.buf = (char *)data_area;
 
   connection_req->dl_primitive = DL_CONNECT_REQ;
-  connection_req->dl_dest_addr_length = rem_addr_len;
+  connection_req->dl_dest_addr_length = remote_addr_len;
   connection_req->dl_dest_addr_offset = sizeof(dl_connect_req_t);
   connection_req->dl_qos_length = 0;
   connection_req->dl_qos_offset = 0;
-  bcopy (rem_addr, 
+  bcopy (remote_addr, 
          (unsigned char *)control_data + sizeof(dl_connect_req_t),
-         rem_addr_len);
+         remote_addr_len);
 
   /* well, I would call the put_control routine here, but the sequence */
   /* of connection stuff with DLPI is a bit screwey with all this */
   /* message passing - Toto, I don't think were in Berkeley anymore. */
 
-  control_message.len = sizeof(dl_connect_req_t) + rem_addr_len;
+  control_message.len = sizeof(dl_connect_req_t) + remote_addr_len;
   if ((error = putmsg(fd,&control_message,0,0)) !=0) {
     fprintf(where,"dl_connect: putmsg failure, errno = %d, error 0x%x \n",
             errno,error);
@@ -3537,10 +3537,10 @@
 }
 
 int
-dl_accept(fd, rem_addr, rem_addr_len)
+dl_accept(fd, remote_addr, remote_addr_len)
      int fd;
-     unsigned char *rem_addr;
-     int rem_addr_len;
+     unsigned char *remote_addr;
+     int remote_addr_len;
 {
   dl_connect_ind_t *connect_ind = (dl_connect_ind_t *)control_data;
   dl_connect_res_t *connect_res = (dl_connect_res_t *)control_data;

Modified: trunk/src/netlib.h
===================================================================
--- trunk/src/netlib.h	2007-02-13 01:17:53 UTC (rev 93)
+++ trunk/src/netlib.h	2007-02-13 20:50:00 UTC (rev 94)
@@ -509,8 +509,12 @@
 extern  struct sendfile_ring_elt *alloc_sendfile_buf_ring();
 #endif /* HAVE_SENDFILE */
 #ifdef WANT_DLPI
-extern  int     dl_connect(int fd, unsigned char *rem_addr, int rem_addr_len);
-extern  int     dl_bind(int fd, int sap, int mode, char *dlsap_ptr, int *dlsap_len);
+/* it seems that AIX in its finite wisdom has some bogus define in an
+   include file which defines "rem_addr" which then screws-up this extern
+   unless we change the names to protect the guilty. reported by Eric
+   Jones */
+extern int dl_connect(int fd, unsigned char *remote_addr, int remote_addr_len);
+extern int dl_bind(int fd, int sap, int mode, char *dlsap_ptr, int *dlsap_len);
 extern  int     dl_open(char devfile[], int ppa);
 #endif /* WANT_DLPI */
 extern  char    format_cpu_method(int method);



More information about the netperf-dev mailing list