projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
4.2 distribution
[unix-history]
/
usr
/
src
/
sys
/
deprecated
/
netimp
/
if_imphost.c
diff --git
a/usr/src/sys/deprecated/netimp/if_imphost.c
b/usr/src/sys/deprecated/netimp/if_imphost.c
index
8d37594
..
3592e7c
100644
(file)
--- a/
usr/src/sys/deprecated/netimp/if_imphost.c
+++ b/
usr/src/sys/deprecated/netimp/if_imphost.c
@@
-1,18
+1,23
@@
-/* if_imphost.c
4.14 82/10/05
*/
+/* if_imphost.c
6.1 83/07/29
*/
#include "imp.h"
#if NIMP > 0
/*
* Host table manipulation routines.
* Only needed when shipping stuff through an IMP.
#include "imp.h"
#if NIMP > 0
/*
* Host table manipulation routines.
* Only needed when shipping stuff through an IMP.
+ *
+ * Everything in here is called at splimp from
+ * from the IMP protocol code (if_imp.c), or
+ * interlocks with the code at splimp.
*/
*/
-
#include "../h/param.h"
#include "../h/mbuf.h"
#include "../h/param.h"
#include "../h/mbuf.h"
-#include "../net/in.h"
-#include "../net/in_systm.h"
-#include "../net/if_imp.h"
-#include "../net/if_imphost.h"
+
+#include "../netinet/in.h"
+#include "../netinet/in_systm.h"
+
+#include "../netimp/if_imp.h"
+#include "../netimp/if_imphost.h"
/*
* Head of host table hash chains.
/*
* Head of host table hash chains.
@@
-30,19
+35,15
@@
hostlookup(addr)
register struct host *hp;
register struct mbuf *m;
register int hash = HOSTHASH(addr);
register struct host *hp;
register struct mbuf *m;
register int hash = HOSTHASH(addr);
- int s = splnet();
for (m = hosts; m; m = m->m_next) {
hp = &mtod(m, struct hmbuf *)->hm_hosts[hash];
if (hp->h_addr.s_addr == addr.s_addr) {
hp->h_flags |= HF_INUSE;
for (m = hosts; m; m = m->m_next) {
hp = &mtod(m, struct hmbuf *)->hm_hosts[hash];
if (hp->h_addr.s_addr == addr.s_addr) {
hp->h_flags |= HF_INUSE;
-
goto found
;
+
return (hp)
;
}
}
}
}
- hp = 0;
-found:
- splx(s);
- return (hp);
+ return ((struct host *)0);
}
/*
}
/*
@@
-57,7
+58,6
@@
hostenter(addr)
register struct mbuf *m, **mprev;
register struct host *hp, *hp0 = 0;
register int hash = HOSTHASH(addr);
register struct mbuf *m, **mprev;
register struct host *hp, *hp0 = 0;
register int hash = HOSTHASH(addr);
- int s = splnet();
mprev = &hosts;
while (m = *mprev) {
mprev = &hosts;
while (m = *mprev) {
@@
-80,11
+80,9
@@
hostenter(addr)
* chain of mbuf's, allocate another.
*/
if (hp0 == 0) {
* chain of mbuf's, allocate another.
*/
if (hp0 == 0) {
- m = m_getclr(M_DONTWAIT);
- if (m == 0) {
- splx(s);
- return (0);
- }
+ m = m_getclr(M_DONTWAIT, MT_HTABLE);
+ if (m == NULL)
+ return ((struct host *)0);
*mprev = m;
hp0 = &mtod(m, struct hmbuf *)->hm_hosts[hash];
}
*mprev = m;
hp0 = &mtod(m, struct hmbuf *)->hm_hosts[hash];
}
@@
-96,7
+94,6
@@
hostenter(addr)
foundhost:
hp->h_flags |= HF_INUSE;
foundhost:
hp->h_flags |= HF_INUSE;
- splx(s);
return (hp);
}
return (hp);
}
@@
-107,12
+104,10
@@
foundhost:
hostfree(hp)
register struct host *hp;
{
hostfree(hp)
register struct host *hp;
{
- int s = splnet();
hp->h_flags &= ~HF_INUSE;
hp->h_timer = HOSTTIMER;
hp->h_rfnm = 0;
hp->h_flags &= ~HF_INUSE;
hp->h_timer = HOSTTIMER;
hp->h_rfnm = 0;
- splx(s);
}
/*
}
/*
@@
-124,7
+119,6
@@
hostreset(net)
register struct mbuf *m;
register struct host *hp, *lp;
struct hmbuf *hm;
register struct mbuf *m;
register struct host *hp, *lp;
struct hmbuf *hm;
- int s = splnet();
for (m = hosts; m; m = m->m_next) {
hm = mtod(m, struct hmbuf *);
for (m = hosts; m; m = m->m_next) {
hm = mtod(m, struct hmbuf *);
@@
-138,13
+132,11
@@
hostreset(net)
hp++;
}
}
hp++;
}
}
- splx(s);
}
/*
* Remove a host structure and release
* any resources it's accumulated.
}
/*
* Remove a host structure and release
* any resources it's accumulated.
- * This routine is always called at splnet.
*/
hostrelease(hp)
register struct host *hp;
*/
hostrelease(hp)
register struct host *hp;
@@
-204,7
+196,7
@@
hostslowtimo()
register struct mbuf *m;
register struct host *hp, *lp;
struct hmbuf *hm;
register struct mbuf *m;
register struct host *hp, *lp;
struct hmbuf *hm;
- int s = spl
net
();
+ int s = spl
imp
();
for (m = hosts; m; m = m->m_next) {
hm = mtod(m, struct hmbuf *);
for (m = hosts; m; m = m->m_next) {
hm = mtod(m, struct hmbuf *);
@@
-219,3
+211,4
@@
hostslowtimo()
}
splx(s);
}
}
splx(s);
}
+#endif