trailing comment after #else or #endif
[unix-history] / usr / src / sys / netiso / tp_pcb.h
index 0efdfe5..8bde24b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)tp_pcb.h    7.17 (Berkeley) %G%
+ *     @(#)tp_pcb.h    7.25 (Berkeley) %G%
  */
 
 /***********************************************************
  */
 
 /***********************************************************
@@ -47,12 +47,12 @@ SOFTWARE.
 #ifndef  __TP_PCB__
 #define  __TP_PCB__
 
 #ifndef  __TP_PCB__
 #define  __TP_PCB__
 
-#include "../netiso/tp_param.h"
-#include "../netiso/tp_timer.h"
-#include "../netiso/tp_user.h"
+#include <netiso/tp_param.h>
+#include <netiso/tp_timer.h>
+#include <netiso/tp_user.h>
 #ifndef sblock
 #ifndef sblock
-#include "socketvar.h"
-#endif sblock
+#include <sys/socketvar.h>
+#endif /* sblock */
 
 /* NOTE: the code depends on REF_CLOSED > REF_OPEN > the rest, and
  * on REF_FREE being zero
 
 /* NOTE: the code depends on REF_CLOSED > REF_OPEN > the rest, and
  * on REF_FREE being zero
@@ -86,11 +86,10 @@ SOFTWARE.
 #define TM_NTIMERS             6
 
 struct tp_ref {
 #define TM_NTIMERS             6
 
 struct tp_ref {
-/*     u_char                          tpr_state; /* values REF_FROZEN, etc. above */
-#define        tpr_state               tpr_pcb->tp_refstate
        struct tp_pcb           *tpr_pcb;       /* back ptr to PCB */
 };
 
        struct tp_pcb           *tpr_pcb;       /* back ptr to PCB */
 };
 
+/* PER system stuff (one static structure instead of a bunch of names) */
 struct tp_refinfo {
        struct tp_ref           *tpr_base;
        int                                     tpr_size;
 struct tp_refinfo {
        struct tp_ref           *tpr_base;
        int                                     tpr_size;
@@ -98,12 +97,6 @@ struct tp_refinfo {
        int                                     tpr_numopen;
 };
 
        int                                     tpr_numopen;
 };
 
-struct tp_param {
-       /* PER system stuff (one static structure instead of a bunch of names) */
-       unsigned        tpp_configed:1;                 /* Has TP been initialized? */
-};
-
-
 struct nl_protosw {
        int             nlp_afamily;                    /* address family */
        int             (*nlp_putnetaddr)();    /* puts addresses in nl pcb */
 struct nl_protosw {
        int             nlp_afamily;                    /* address family */
        int             (*nlp_putnetaddr)();    /* puts addresses in nl pcb */
@@ -129,12 +122,12 @@ struct tp_pcb {
        struct tp_pcb           *tp_next;
        struct tp_pcb           *tp_prev;
        struct tp_pcb           *tp_nextlisten; /* chain all listeners */
        struct tp_pcb           *tp_next;
        struct tp_pcb           *tp_prev;
        struct tp_pcb           *tp_nextlisten; /* chain all listeners */
+       struct socket           *tp_sock;               /* back ptr */
        u_short                         tp_state;               /* state of fsm */
        short                           tp_retrans;             /* # times can still retrans */
        u_short                         tp_state;               /* state of fsm */
        short                           tp_retrans;             /* # times can still retrans */
-       struct tp_ref           *tp_refp;               /* rest of pcb  */
        caddr_t                         tp_npcb;                /* to lower layer pcb */
        struct nl_protosw       *tp_nlproto;    /* lower-layer dependent routines */
        caddr_t                         tp_npcb;                /* to lower layer pcb */
        struct nl_protosw       *tp_nlproto;    /* lower-layer dependent routines */
-       struct socket           *tp_sock;               /* back ptr */
+       struct rtentry          **tp_routep;    /* obtain mtu; inside npcb */
 
 
        RefNum                          tp_lref;                /* local reference */
 
 
        RefNum                          tp_lref;                /* local reference */
@@ -174,6 +167,7 @@ struct tp_pcb {
        u_short                         tp_maxlcredit;  /* needed for reassembly queue */
        struct mbuf                     **tp_rsyq;              /* unacked stuff recvd out of order */
        int                                     tp_rsycnt;              /* number of packets "" "" "" ""    */
        u_short                         tp_maxlcredit;  /* needed for reassembly queue */
        struct mbuf                     **tp_rsyq;              /* unacked stuff recvd out of order */
        int                                     tp_rsycnt;              /* number of packets "" "" "" ""    */
+       u_long                          tp_rhiwat;              /* remember original RCVBUF size */
 
        /* receiver congestion state stuff ...  */
        u_int               tp_win_recv;
 
        /* receiver congestion state stuff ...  */
        u_int               tp_win_recv;
@@ -215,6 +209,7 @@ struct tp_pcb {
 #define        tp_dont_change_params _tp_param.p_dont_change_params
 #define        tp_netservice _tp_param.p_netservice
 #define        tp_version _tp_param.p_version
 #define        tp_dont_change_params _tp_param.p_dont_change_params
 #define        tp_netservice _tp_param.p_netservice
 #define        tp_version _tp_param.p_version
+#define        tp_ptpdusize _tp_param.p_ptpdusize
 
        int                                     tp_l_tpdusize;
                /* whereas tp_tpdusize is log2(the negotiated max size)
 
        int                                     tp_l_tpdusize;
                /* whereas tp_tpdusize is log2(the negotiated max size)
@@ -228,15 +223,9 @@ struct tp_pcb {
        int                                     tp_idle;                /* last activity, in ticks */
        short                           tp_rxtcur;              /* current retransmit value */
        short                           tp_rxtshift;    /* log(2) of rexmt exp. backoff */
        int                                     tp_idle;                /* last activity, in ticks */
        short                           tp_rxtcur;              /* current retransmit value */
        short                           tp_rxtshift;    /* log(2) of rexmt exp. backoff */
-
-       unsigned 
-               tp_sendfcc:1,                   /* shall next ack include FCC parameter? */
-               tp_trace:1,                             /* is this pcb being traced? (not used yet) */
-               tp_perf_on:1,                   /* 0/1 -> performance measuring on  */
-               tp_reneged:1,                   /* have we reneged on cdt since last ack? */
-               tp_decbit:3,                    /* dec bit was set, we're in reneg mode  */
-               tp_cebit_off:1,                 /* the real DEC bit algorithms not in use */
-               tp_flags:8,                             /* values: */
+       u_char                          tp_cebit_off;   /* real DEC bit algorithms not in use */
+       u_char                          tp_oktonagle;   /* Last unsent pckt may be append to */
+       u_char                          tp_flags;               /* values: */
 #define TPF_NLQOS_PDN          TPFLAG_NLQOS_PDN
 #define TPF_PEER_ON_SAMENET    TPFLAG_PEER_ON_SAMENET
 #define TPF_GENERAL_ADDR       TPFLAG_GENERAL_ADDR
 #define TPF_NLQOS_PDN          TPFLAG_NLQOS_PDN
 #define TPF_PEER_ON_SAMENET    TPFLAG_PEER_ON_SAMENET
 #define TPF_GENERAL_ADDR       TPFLAG_GENERAL_ADDR
@@ -246,16 +235,21 @@ struct tp_pcb {
 #define PEER_IS_LOCAL(t)       (((t)->tp_flags & TPF_PEER_ON_SAME_NET) != 0)
 #define USES_PDN(t)                    (((t)->tp_flags & TPF_NLQOS_PDN) != 0)
 
 #define PEER_IS_LOCAL(t)       (((t)->tp_flags & TPF_PEER_ON_SAME_NET) != 0)
 #define USES_PDN(t)                    (((t)->tp_flags & TPF_NLQOS_PDN) != 0)
 
-               tp_oktonagle:1,                 /* Last unsent packet that may be append to */
-               tp_notdetached:1,               /* Call tp_detach before freeing XXXXXXX */
-               tp_unused:14;
 
 
+       unsigned 
+               tp_sendfcc:1,                   /* shall next ack include FCC parameter? */
+               tp_trace:1,                             /* is this pcb being traced? (not used yet) */
+               tp_perf_on:1,                   /* 0/1 -> performance measuring on  */
+               tp_reneged:1,                   /* have we reneged on cdt since last ack? */
+               tp_decbit:3,                    /* dec bit was set, we're in reneg mode  */
+               tp_notdetached:1;               /* Call tp_detach before freeing XXXXXXX */
 
 #ifdef TP_PERF_MEAS
        /* performance stats - see tp_stat.h */
        struct tp_pmeas         *tp_p_meas;
        struct mbuf                     *tp_p_mbuf;
 
 #ifdef TP_PERF_MEAS
        /* performance stats - see tp_stat.h */
        struct tp_pmeas         *tp_p_meas;
        struct mbuf                     *tp_p_mbuf;
-#endif TP_PERF_MEAS
+#endif /* TP_PERF_MEAS */
+
        /* addressing */
        u_short                         tp_domain;              /* domain (INET, ISO) */
        /* for compatibility with the *old* way and with INET, be sure that
        /* addressing */
        u_short                         tp_domain;              /* domain (INET, ISO) */
        /* for compatibility with the *old* way and with INET, be sure that
@@ -275,7 +269,6 @@ struct tp_pcb {
        u_char                          tp_refstate;            /* values REF_FROZEN, etc. above */
        struct tp_pcb           *tp_fasttimeo;          /* limit pcbs to examine */
        u_int                           tp_timer[TM_NTIMERS]; /* C timers */
        u_char                          tp_refstate;            /* values REF_FROZEN, etc. above */
        struct tp_pcb           *tp_fasttimeo;          /* limit pcbs to examine */
        u_int                           tp_timer[TM_NTIMERS]; /* C timers */
-       struct Ecallarg         tp_retransargs;         /* dunt ask ... */
 
        struct sockbuf          tp_Xsnd;                /* for expedited data */
 /*     struct sockbuf          tp_Xrcv;                /* for expedited data */
 
        struct sockbuf          tp_Xsnd;                /* for expedited data */
 /*     struct sockbuf          tp_Xrcv;                /* for expedited data */
@@ -299,7 +292,7 @@ u_int       tp_start_win;
 #define CONG_INIT_SAMPLE(pcb) \
        pcb->tp_cong_sample.cs_received = \
     pcb->tp_cong_sample.cs_ce_set = 0; \
 #define CONG_INIT_SAMPLE(pcb) \
        pcb->tp_cong_sample.cs_received = \
     pcb->tp_cong_sample.cs_ce_set = 0; \
-    pcb->tp_cong_sample.cs_size = MAX(pcb->tp_lcredit, 1) << 1;
+    pcb->tp_cong_sample.cs_size = max(pcb->tp_lcredit, 1) << 1;
 
 #define CONG_UPDATE_SAMPLE(pcb, ce_bit) \
     pcb->tp_cong_sample.cs_received++; \
 
 #define CONG_UPDATE_SAMPLE(pcb, ce_bit) \
     pcb->tp_cong_sample.cs_received++; \
@@ -310,7 +303,7 @@ u_int       tp_start_win;
         if ((pcb->tp_cong_sample.cs_ce_set << 1) >=  \
                     pcb->tp_cong_sample.cs_size ) { \
             pcb->tp_win_recv -= pcb->tp_win_recv >> 3; /* multiply by .875 */ \
         if ((pcb->tp_cong_sample.cs_ce_set << 1) >=  \
                     pcb->tp_cong_sample.cs_size ) { \
             pcb->tp_win_recv -= pcb->tp_win_recv >> 3; /* multiply by .875 */ \
-            pcb->tp_win_recv = MAX(1 << 8, pcb->tp_win_recv); \
+            pcb->tp_win_recv = max(1 << 8, pcb->tp_win_recv); \
         } \
         else { \
             pcb->tp_win_recv += (1 << 8); /* add one to the scaled int */ \
         } \
         else { \
             pcb->tp_win_recv += (1 << 8); /* add one to the scaled int */ \
@@ -334,4 +327,4 @@ extern struct tp_pcb        *tp_ftimeolist;
 #define        tpcbtoso(tp)    ((struct socket *)((tp)->tp_sock))
 #define        tpcbtoref(tp)   ((struct tp_ref *)((tp)->tp_ref))
 
 #define        tpcbtoso(tp)    ((struct socket *)((tp)->tp_sock))
 #define        tpcbtoref(tp)   ((struct tp_ref *)((tp)->tp_ref))
 
-#endif  __TP_PCB__
+#endif  /* __TP_PCB__ */