rx: Hide the rx_packet.h
authorSimon Wilkinson <sxw@your-file-system.com>
Sun, 20 Nov 2011 16:31:28 +0000 (16:31 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 4 Dec 2011 04:45:09 +0000 (20:45 -0800)
Hide the rx_packet.h, and hence the rx_packet structure from
application view. rx_packet.h is currently still installed, and is
included directly by RX security classes, to reduce the per-packet
overhead there.

Change-Id: I269ccf4405a8f83cab4b0392b830bc1f36471c29
Reviewed-on: http://gerrit.openafs.org/6182
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

18 files changed:
src/ptserver/ptserver.c
src/rx/DARWIN/rx_knet.c
src/rx/rx.c
src/rx/rx.h
src/rx/rx_globals.c
src/rx/rx_kcommon.c
src/rx/rx_lwp.c
src/rx/rx_packet.h
src/rx/rx_pthread.c
src/rx/rx_rdwr.c
src/rx/rx_user.c
src/rx/rx_xmit_nt.c
src/rx/test/rxperf.c
src/rxkad/bg-fcrypt.c
src/rxkad/crypt_conn.c
src/rxkad/rxkad_client.c
src/rxkad/rxkad_common.c
src/rxkad/rxkad_server.c

index 0b473af..89bfa9d 100644 (file)
@@ -494,6 +494,7 @@ main(int argc, char **argv)
        afs_com_err(whoami, code, "Ubik init failed");
        PT_EXIT(2);
     }
+
 #if defined(SUPERGROUPS)
     pt_hook_write();
 #endif
index 70233c8..09c1784 100644 (file)
@@ -12,6 +12,7 @@
 
 
 #include "rx/rx_kcommon.h"
+#include "rx/rx_packet.h"
 #include "rx/rx_atomic.h"
 #include "rx/rx_stats.h"
 
index 241ec72..1594a11 100644 (file)
@@ -82,6 +82,7 @@ extern afs_int32 afs_termState;
 
 #include "rx_conn.h"
 #include "rx_call.h"
+#include "rx_packet.h"
 
 #include <afs/rxgen_consts.h>
 
index 5668eba..8572834 100644 (file)
@@ -52,9 +52,9 @@
 #endif
 #endif /* KERNEL */
 
+#include "rx_queue.h"
 #include "rx_clock.h"
 #include "rx_event.h"
-#include "rx_packet.h"
 #include "rx_misc.h"
 #include "rx_null.h"
 #include "rx_multi.h"
 /* These items are part of the new RX API. They're living in this section
  * for now, to keep them separate from everything else... */
 
-/* Connection management */
 struct rx_connection;
+struct rx_call;
+struct rx_packet;
+
+/* Connection management */
 
 extern void rx_SetConnectionEpoch(struct rx_connection *conn, int epoch);
 extern int  rx_GetConnectionEpoch(struct rx_connection *conn);
@@ -102,6 +105,29 @@ extern void rx_RecordCallStatistics(struct rx_call *call,
                                    int isServer);
 
 
+/* Packets */
+
+/* Packet classes, for rx_AllocPacket and rx_packetQuota */
+#define        RX_PACKET_CLASS_RECEIVE     0
+#define        RX_PACKET_CLASS_SEND        1
+#define        RX_PACKET_CLASS_SPECIAL     2
+#define        RX_PACKET_CLASS_RECV_CBUF   3
+#define        RX_PACKET_CLASS_SEND_CBUF   4
+
+#define        RX_N_PACKET_CLASSES         5   /* Must agree with above list */
+
+#define        RX_PACKET_TYPES     {"data", "ack", "busy", "abort", "ackall", "challenge", "response", "debug", "params", "unused", "unused", "unused", "version"}
+#define        RX_N_PACKET_TYPES           13  /* Must agree with above list;
+                                        * counts 0
+                                        * WARNING: if this number ever
+                                        * grows past 13, rxdebug packets
+                                        * will need to be modified */
+
+
+/* For most Unixes, maximum elements in an iovec is 16 */
+#define RX_MAXIOVECS 16                        /* limit for ReadvProc/WritevProc */
+#define RX_MAXWVECS (RX_MAXIOVECS-1)   /* need one iovec for packet header */
+
 /* Debugging */
 
 /* Call flags, states and modes are exposed by the debug interface */
@@ -144,6 +170,7 @@ extern void rx_RecordCallStatistics(struct rx_call *call,
 
 #endif
 
+
 /* Configurable parameters */
 #define        RX_IDLE_DEAD_TIME       60      /* default idle dead time */
 #define        RX_MAX_SERVICES         20      /* Maximum number of services that may be installed */
@@ -654,6 +681,7 @@ struct rx_securityClass {
 #define RXS_SetConfiguration(obj, conn, type, value, currentValue) RXS_OP(obj, SetConfiguration,(obj,conn,type,value,currentValue))
 
 
+
 /* Structure for keeping rx statistics.  Note that this structure is returned
  * by rxdebug, so, for compatibility reasons, new fields should be appended (or
  * spares used), the rxdebug protocol checked, if necessary, and the PrintStats
index cfaaa04..baecede 100644 (file)
@@ -41,6 +41,9 @@
 # include <roken.h>
 #endif /* KERNEL */
 
+#include "rx.h"
+#include "rx_clock.h"
+#include "rx_packet.h"
 #include "rx_globals.h"
 
 void rx_SetMaxReceiveWindow(int packets)
index 64d95e9..8a50729 100644 (file)
@@ -16,6 +16,7 @@
 
 
 #include "rx/rx_kcommon.h"
+#include "rx_packet.h"
 #include "rx_atomic.h"
 #include "rx_stats.h"
 
index aa1c5bb..4d775bc 100644 (file)
@@ -33,6 +33,9 @@
 #include "rx_atomic.h"
 #include "rx_globals.h"
 #include "rx_stats.h"
+#ifdef AFS_NT40_ENV
+#include "rx_xmit_nt.h"
+#endif
 
 #define MAXTHREADNAMELENGTH 64
 
@@ -461,7 +464,13 @@ rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
 #endif
            return -1;
        }
-       while ((err = select(socket + 1, 0, sfds, 0, 0)) != 1) {
+       while ((err = select(
+#ifdef AFS_NT40_ENV
+                             0,
+#else
+                             socket + 1,
+#endif
+                             0, sfds, 0, 0)) != 1) {
            if (err >= 0 || errno != EINTR)
                osi_Panic("rxi_sendmsg: select error %d.%d", err, errno);
            FD_ZERO(sfds);
index 9b11d88..0fbec34 100644 (file)
 #define RX_PACKET_TYPE_PARAMS       9  /* exchange size params (showUmine) */
 #define RX_PACKET_TYPE_VERSION    13   /* get AFS version */
 
-
-#define        RX_PACKET_TYPES     {"data", "ack", "busy", "abort", "ackall", "challenge", "response", "debug", "params", "unused", "unused", "unused", "version"}
-#define        RX_N_PACKET_TYPES           13  /* Must agree with above list;
-                                        * counts 0
-                                        * WARNING: if this number ever
-                                        * grows past 13, rxdebug packets
-                                        * will need to be modified */
-
-/* Packet classes, for rx_AllocPacket and rx_packetQuota */
-#define        RX_PACKET_CLASS_RECEIVE     0
-#define        RX_PACKET_CLASS_SEND        1
-#define        RX_PACKET_CLASS_SPECIAL     2
-#define        RX_PACKET_CLASS_RECV_CBUF   3
-#define        RX_PACKET_CLASS_SEND_CBUF   4
-
-#define        RX_N_PACKET_CLASSES         5   /* Must agree with above list */
-
 /* Flags for rx_header flags field */
 #define        RX_CLIENT_INITIATED     1       /* Packet is sent/received from client side of call */
 #define        RX_REQUEST_ACK          2       /* Peer requests acknowledgement */
@@ -212,9 +195,7 @@ struct rx_jumboHeader {
     u_short cksum;             /* packet header checksum */
 };
 
-/* For most Unixes, maximum elements in an iovec is 16 */
-#define RX_MAXIOVECS 16                        /* limit for ReadvProc/WritevProc */
-#define RX_MAXWVECS (RX_MAXIOVECS-1)   /* need one iovec for packet header */
+
 
 /*
  * The values for the RX buffer sizes are calculated to ensure efficient
index 8bf91e4..97f058c 100644 (file)
@@ -28,6 +28,9 @@
 #include "rx_pthread.h"
 #include "rx_clock.h"
 #include "rx_atomic.h"
+#ifdef AFS_NT40_ENV
+#include "rx_xmit_nt.h"
+#endif
 
 static void rxi_SetThreadNum(int threadID);
 
index d470f74..28c3ee0 100644 (file)
@@ -62,6 +62,7 @@
 
 #include "rx_conn.h"
 #include "rx_call.h"
+#include "rx_packet.h"
 
 #ifdef RX_LOCKS_DB
 /* rxdb_fileID is used to identify the lock location, along with line#. */
index d259560..e54e15d 100644 (file)
@@ -48,6 +48,8 @@
 #include "rx_atomic.h"
 #include "rx_globals.h"
 #include "rx_stats.h"
+#include "rx_packet.h"
+
 #ifdef AFS_PTHREAD_ENV
 
 /*
index 8e52957..a9842ad 100644 (file)
@@ -55,8 +55,8 @@ INT
 #endif /* AFS_NT40_ENV */
 
 #include "rx.h"
-#include "rx_packet.h"
 #include "rx_globals.h"
+#include "rx_packet.h"
 #include "rx_xmit_nt.h"
 #include <malloc.h>
 #include <errno.h>
index 7f0b8d9..3a71ca1 100644 (file)
@@ -82,6 +82,7 @@ nn * We are using getopt since we want it to be possible to link to
 #include <rx/rx.h>
 #include <rx/rx_null.h>
 #include <rx/rx_globals.h>
+#include <rx/rx_packet.h>
 
 #ifdef AFS_PTHREAD_ENV
 #include <pthread.h>
index 24a81ae..eaf0d04 100644 (file)
@@ -51,6 +51,7 @@
 #else /* KERNEL */
 #include <roken.h>
 #include <rx/rx.h>
+#include <rx/rx_packet.h>
 #endif /* KERNEL */
 
 #include "fcrypt.h"
index 20b91bf..99f29bf 100644 (file)
@@ -30,6 +30,7 @@
 #endif /* KERNEL */
 
 #include <rx/rx.h>
+#include <rx/rx_packet.h>
 #include <rx/rxkad_stats.h>
 #include "private_data.h"
 #define XPRT_RXKAD_CRYPT
index 2657f70..a871349 100644 (file)
@@ -38,6 +38,7 @@
 
 #include <rx/rx.h>
 #include <rx/xdr.h>
+#include <rx/rx_packet.h>
 
 #include "rxkad.h"
 #include "stats.h"
index 83e6d1e..f9a80a6 100644 (file)
@@ -43,6 +43,7 @@
 #endif /* KERNEL */
 
 #include <rx/rx.h>
+#include <rx/rx_packet.h>
 #include <rx/xdr.h>
 
 #include "stats.h"
index 5c7a0ef..125ab84 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <rx/rx.h>
 #include <rx/xdr.h>
+#include <rx/rx_packet.h>
 #include <afs/afsutil.h>
 
 #include "stats.h"