/* if_imphost.h 4.5 82/03/09 */
* Host structure used with IMP's.
* Used to hold outgoing packets which
* would exceed allowed RFNM count.
* These structures are packed into
* mbuf's and kept as small as possible.
struct mbuf
*h_q
; /* holding queue */
struct in_addr h_addr
; /* host's address */
short h_qcnt
; /* size of holding q */
u_char h_rfnm
; /* # outstanding rfnm's */
u_char h_refcnt
; /* reference count */
* Host structures, as seen inside an mbuf.
* Hashing on the host address is used to
* select an index into the first mbuf. Collisions
* are then resolved by searching successive
* mbuf's at the same index. Reclamation is done
* automatically at the time a structure is free'd.
#define HPMBUF ((MLEN - sizeof(int)) / sizeof(struct host))
#define HOSTHASH(a) ((((a).s_addr>>8)+(a).s_net) % HPMBUF)
* In-line expansions for queuing operations on
* host message holding queue. Queue is maintained
* as circular list with the head pointing to the
* last message in the queue.
#define HOST_ENQUE(hp, m) { \
register struct mbuf *n; \
if ((n = (hp)->h_q) == 0) \
(hp)->h_q = (m)->m_act = (m); \
(hp)->h_q = n->m_act = (m); \
#define HOST_DEQUE(hp, m) { \
(hp)->h_q->m_act = (m)->m_act; \
int hm_count
; /* # of struct's in use */
struct host hm_hosts
[HPMBUF
]; /* data structures proper */
struct host
*hostlookup();
struct host
*hostenter();
struct mbuf
*hostdeque();