mars_nwe-0.96.pl05
This commit is contained in:
parent
c374994026
commit
42aa23ed0b
5
CHANGES
5
CHANGES
@ -47,8 +47,9 @@ Erste 'oeffentliche' Version
|
||||
- MAX_NW_ROUTES ist nun in config.h.
|
||||
- nwroute.c build_rip_buff if condition richtig geklammert.
|
||||
- Code mittels cc -Wall etwas gesaeubert.
|
||||
- RIP Broadcast's werden nun ueber einen temporaeren socket
|
||||
geschrieben.
|
||||
- direkte Responses von ncpserv werden nun ueber einen
|
||||
temporaeren socket und nicht mehr ueber den NCP-Socket
|
||||
geschrieben.
|
||||
- SAP Responses gehen nun immer ueber den SAP Socket.
|
||||
- Routing Bereich (SAP's) erweitert.
|
||||
|
||||
|
2
README
2
README
@ -56,7 +56,7 @@ o - clean the code !!!
|
||||
o - make bindery code more complete.
|
||||
o - and much more ...
|
||||
|
||||
Have luck with tryimg. :)
|
||||
Have luck with trying. :)
|
||||
|
||||
|
||||
Martin
|
||||
|
32
examples/kpatch1.3.56
Normal file
32
examples/kpatch1.3.56
Normal file
@ -0,0 +1,32 @@
|
||||
--- ORG/af_ipx.c Sat Jan 6 13:54:59 1996
|
||||
+++ af_ipx.c Thu Jan 11 14:36:21 1996
|
||||
@@ -994,7 +994,9 @@
|
||||
return -EAGAIN;
|
||||
rt->ir_next=ipx_routes;
|
||||
ipx_routes=rt;
|
||||
- }
|
||||
+ } else if (intrfc == ipx_internal_net)
|
||||
+ /* don't change an existing route to internal net (mars_nwe) */
|
||||
+ return(0);
|
||||
|
||||
rt->ir_net = network;
|
||||
rt->ir_intrfc = intrfc;
|
||||
@@ -1108,9 +1110,15 @@
|
||||
ipx->ipx_tctrl=0;
|
||||
ipx->ipx_type=usipx->sipx_type;
|
||||
skb->h.raw = (unsigned char *)ipx;
|
||||
-
|
||||
- ipx->ipx_source.net = sk->ipx_intrfc->if_netnum;
|
||||
- memcpy(ipx->ipx_source.node, sk->ipx_intrfc->if_node, IPX_NODE_LEN);
|
||||
+
|
||||
+ if ((err = ntohs(sk->ipx_port)) == 0x453 || err == 0x452) {
|
||||
+ /* RIP/SAP special handling for mars_nwe */
|
||||
+ ipx->ipx_source.net = intrfc->if_netnum;
|
||||
+ memcpy(ipx->ipx_source.node, intrfc->if_node, IPX_NODE_LEN);
|
||||
+ } else {
|
||||
+ ipx->ipx_source.net = sk->ipx_intrfc->if_netnum;
|
||||
+ memcpy(ipx->ipx_source.node, sk->ipx_intrfc->if_node, IPX_NODE_LEN);
|
||||
+ }
|
||||
ipx->ipx_source.sock = sk->ipx_port;
|
||||
ipx->ipx_dest.net=usipx->sipx_network;
|
||||
memcpy(ipx->ipx_dest.node,usipx->sipx_node,IPX_NODE_LEN);
|
@ -30,6 +30,8 @@
|
||||
######################################
|
||||
# next entry for later use, not yet supported !!
|
||||
# the ipx kernel code must changed first, to do good routing !!
|
||||
# If you have mars_nwe V > 0.96pl4 and the small ipx-kpatch
|
||||
# you can use Internal Net and Routing.
|
||||
# INTERNAL NET [NODE]
|
||||
###3 0x999999 1 # Node default 1
|
||||
######################################
|
||||
|
@ -6,7 +6,7 @@ C=.c
|
||||
DEBUG=-DDB
|
||||
V_H=0
|
||||
V_L=96
|
||||
P_L=4
|
||||
P_L=5
|
||||
#define D_P_L 1
|
||||
DISTRIB=mars_nwe
|
||||
#if D_P_L
|
||||
|
27
ncpserv.c
27
ncpserv.c
@ -286,7 +286,7 @@ static void get_login_time(uint8 login_time[], CONNECTION *cx)
|
||||
|
||||
|
||||
static int handle_fxx(CONNECTION *c, int gelen, int func)
|
||||
/* here are handled the global 0x15, 0x17 functions */
|
||||
/* here are handled the global 0x15, 0x17, 0x57 functions */
|
||||
{
|
||||
IPX_DATA ipxoutdata;
|
||||
NCPRESPONSE *ncpresponse = (NCPRESPONSE*)&ipxoutdata;
|
||||
@ -1130,8 +1130,9 @@ static int handle_fxx(CONNECTION *c, int gelen, int func)
|
||||
|
||||
default : return(-1); /* not known here */
|
||||
} /* switch */
|
||||
} else if (0x57 == func) { /* namespace functions not handled !! */
|
||||
completition = 0xfb; /* 2.15 don't kwown namespace services */
|
||||
} else return(-1); /* not kwown here */
|
||||
|
||||
U16_TO_BE16(0x3333, ncpresponse->type);
|
||||
ncpresponse->sequence = ncprequest->sequence;
|
||||
ncpresponse->connection = ncprequest->connection;
|
||||
@ -1376,6 +1377,13 @@ int main(int argc, char *argv[])
|
||||
case 0x17 : /* File Server Environment */
|
||||
sent_here = handle_fxx(c, in_len, func);
|
||||
break;
|
||||
|
||||
case 0x57 : if (!tells_server_version) {
|
||||
/* 2.15 er has no namespace_calls */
|
||||
sent_here = handle_fxx(c, in_len, func);
|
||||
}
|
||||
break;
|
||||
|
||||
default : break;
|
||||
} /* switch */
|
||||
|
||||
@ -1389,13 +1397,16 @@ int main(int argc, char *argv[])
|
||||
c->sequence = ncprequest->sequence; /* save last sequence */
|
||||
c->retry = 0;
|
||||
continue;
|
||||
} else { /* 0x5555, conection beenden */
|
||||
} else { /* 0x5555, close connection */
|
||||
if ( (uint8) (c->sequence+1) == (uint8) ncprequest->sequence) {
|
||||
clear_connection(ncprequest->connection);
|
||||
ncp_response(0x3333,
|
||||
ncprequest->sequence,
|
||||
connection,
|
||||
1, 0x0, 0, 0);
|
||||
1, /* task */
|
||||
0x0, /* completition */
|
||||
0, /* conn status */
|
||||
0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1409,7 +1420,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
ncp_response(0x3333, ncprequest->sequence,
|
||||
ncprequest->connection,
|
||||
0,
|
||||
0, /* task */
|
||||
0xff, /* completition */
|
||||
0xff, /* conn status */
|
||||
0);
|
||||
@ -1427,7 +1438,11 @@ int main(int argc, char *argv[])
|
||||
anz=write(c->fd, (char*)ncprequest, in_len);
|
||||
XDPRINTF((10, 0, "write to oldconn %d, anz = %d", c->fd, anz));
|
||||
} else /* no free connection */
|
||||
ncp_response(0x3333, 0, 0, 0, 0xf9, 0, 0);
|
||||
ncp_response(0x3333, 0, 0, 0,
|
||||
0xf9, /* completition */
|
||||
0, /* conn status */
|
||||
0);
|
||||
|
||||
} else {
|
||||
int connection = (int)ncprequest->connection;
|
||||
int sequence = (int)ncprequest->sequence;
|
||||
|
159
nwroute.c
159
nwroute.c
@ -1,4 +1,4 @@
|
||||
/* nwroute.c 08-Jan-96 */
|
||||
/* nwroute.c 11-Jan-96 */
|
||||
/* (C)opyright (C) 1993,1995 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -24,7 +24,6 @@ typedef struct {
|
||||
uint32 net; /* destnet */
|
||||
uint16 hops; /* hops to net */
|
||||
uint16 ticks; /* ticks to net, ether 1/hop, isdn 7/hop */
|
||||
|
||||
uint32 rnet; /* net of forw. router */
|
||||
uint8 rnode[IPX_NODE_SIZE]; /* node of forw. router */
|
||||
} NW_ROUTES;
|
||||
@ -32,6 +31,18 @@ typedef struct {
|
||||
static int anz_routes=0;
|
||||
static NW_ROUTES *nw_routes[MAX_NW_ROUTES];
|
||||
|
||||
typedef struct {
|
||||
uint8 *name;
|
||||
int typ;
|
||||
ipxAddr_t addr;
|
||||
int net; /* routing over NET */
|
||||
int hops;
|
||||
int flags;
|
||||
} NW_SERVERS;
|
||||
|
||||
static int anz_servers=0;
|
||||
static NW_SERVERS *nw_servers[MAX_NW_ROUTES];
|
||||
|
||||
static void insert_delete_net(uint32 destnet,
|
||||
uint32 rnet, /* routernet */
|
||||
uint8 *rnode, /* routernode */
|
||||
@ -57,7 +68,7 @@ static void insert_delete_net(uint32 destnet,
|
||||
|
||||
k=-1;
|
||||
while (++k < anz_routes && nw_routes[k]->net != destnet) {
|
||||
XDPRINTF((3,0, "NET 0x%X is routed", nw_routes[k]->net));
|
||||
XDPRINTF((3,0, "NET 0x%x is routed", nw_routes[k]->net));
|
||||
if (freeslot < 0 && !nw_routes[k]->net) freeslot=k;
|
||||
}
|
||||
|
||||
@ -78,15 +89,14 @@ static void insert_delete_net(uint32 destnet,
|
||||
nr->hops = 0xffff;
|
||||
} else if (do_delete) {
|
||||
nr=nw_routes[k];
|
||||
if (nr->rnet == rnet &&
|
||||
IPXCMPNODE(nr->rnode, rnode) ) {
|
||||
if (nr->rnet == rnet && IPXCMPNODE(nr->rnode, rnode) ) {
|
||||
/* only delete the routes, which we have inserted */
|
||||
XDPRINTF((2,0,"ROUTE DEL NET=0x%X over Router NET 0x%X",
|
||||
XDPRINTF((2,0,"ROUTE DEL NET=0x%x over Router NET 0x%x",
|
||||
nr->net, rnet));
|
||||
ipx_route_del(nr->net);
|
||||
nr->net = 0L;
|
||||
} else {
|
||||
XDPRINTF((3,0,"ROUTE NOT deleted NET=0x%X, RNET=0X%X",
|
||||
XDPRINTF((3,0,"ROUTE NOT deleted NET=0x%x, RNET=0x%x",
|
||||
nr->net, rnet));
|
||||
}
|
||||
return;
|
||||
@ -106,6 +116,75 @@ static void insert_delete_net(uint32 destnet,
|
||||
}
|
||||
}
|
||||
|
||||
void insert_delete_server(uint8 *name,
|
||||
int styp,
|
||||
ipxAddr_t *addr,
|
||||
ipxAddr_t *from_addr,
|
||||
int hops,
|
||||
int do_delete, /* delete = 1 */
|
||||
int flags)
|
||||
{
|
||||
int k=-1;
|
||||
int freeslot=-1;
|
||||
uint32 net;
|
||||
uint8 sname[MAX_SERVER_NAME+2];
|
||||
NW_SERVERS *nr=NULL;
|
||||
strmaxcpy(sname, name, MAX_SERVER_NAME);
|
||||
upstr(sname);
|
||||
XDPRINTF((3,0,"%s %s %s,0x%04x",
|
||||
visable_ipx_adr(addr),
|
||||
(do_delete) ? "DEL" : "INS", sname, (int) styp));
|
||||
k=-1;
|
||||
|
||||
if (!*sname) return;
|
||||
|
||||
while (++k < anz_servers && (nw_servers[k]->typ != styp ||
|
||||
!nw_servers[k]->name || strcmp(nw_servers[k]->name, sname)) ) {
|
||||
if (nw_servers[k]->name) {
|
||||
XDPRINTF((3,0, "Server %s = typ=0x%04x",
|
||||
nw_servers[k]->name, nw_servers[k]->typ));
|
||||
}
|
||||
if (freeslot < 0 && !nw_servers[k]->typ) freeslot=k;
|
||||
}
|
||||
|
||||
if (k == anz_servers) { /* server not found */
|
||||
if (do_delete) return; /* nothing to delete */
|
||||
|
||||
if (freeslot < 0) {
|
||||
if (anz_servers == MAX_NW_ROUTES) {
|
||||
XDPRINTF((1, 0, "too many servers=%d, increase MAX_NW_ROUTES in config.h", anz_servers));
|
||||
return;
|
||||
}
|
||||
nw_servers[k] = (NW_SERVERS*)xcmalloc(sizeof(NW_SERVERS));
|
||||
anz_servers++;
|
||||
} else k=freeslot;
|
||||
nr = nw_servers[k];
|
||||
new_str(nr->name, sname);
|
||||
nr->typ = styp;
|
||||
nr->hops = 0xffff;
|
||||
} else if (do_delete) {
|
||||
nr=nw_servers[k];
|
||||
if (nr->typ == 4) ins_del_bind_net_addr(nr->name, NULL);
|
||||
xfree(nr->name);
|
||||
memset(nr, 0, sizeof(NW_SERVERS));
|
||||
return;
|
||||
} else nr=nw_servers[k];
|
||||
/* here now i perhaps must change the entry */
|
||||
if (nr->hops > 16 || memcmp(&(nr->addr), addr, sizeof(ipxAddr_t))) {
|
||||
ins_del_bind_net_addr(nr->name, addr);
|
||||
memcpy(&(nr->addr), addr, sizeof(ipxAddr_t));
|
||||
if (IPXCMPNODE(from_addr->node, my_server_adr.node) &&
|
||||
IPXCMPNET (from_addr->net, my_server_adr.net)
|
||||
&& GET_BE16(from_addr->sock) == SOCK_SAP) {
|
||||
hops = 0;
|
||||
}
|
||||
}
|
||||
if (hops <= nr->hops && 0 != (net = GET_BE32(from_addr->net)) ) {
|
||||
nr->net = net;
|
||||
nr->hops = hops;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32 rnet=0L;
|
||||
static int rentries=0;
|
||||
static int rmode; /* 0=normal, 1=shutdown, 10=request */
|
||||
@ -131,7 +210,8 @@ static void ins_rip_buff(uint32 net, uint16 hops, uint16 ticks)
|
||||
}
|
||||
}
|
||||
|
||||
static void build_rip_buff(uint32 destnet)
|
||||
static void build_rip_buff(uint32 destnet, int to_internal_net)
|
||||
/* to_internal_net = request from dosemu etc. */
|
||||
{
|
||||
int is_wild = (destnet==MAX_U32);
|
||||
int is_response = (rmode < 10);
|
||||
@ -155,7 +235,12 @@ static void build_rip_buff(uint32 destnet)
|
||||
k=-1;
|
||||
while (++k < anz_routes) {
|
||||
NW_ROUTES *nr=nw_routes[k];
|
||||
if ( (is_wild || nr->net == destnet) && (rmode==1 || nr->hops < 2) )
|
||||
#if 0
|
||||
if ( (is_wild || nr->net == destnet) &&
|
||||
(rmode==1 || nr->hops < 2 || to_internal_net) )
|
||||
#else
|
||||
if (is_wild || (nr->net == destnet))
|
||||
#endif
|
||||
ins_rip_buff(nr->net, (rmode==1) ? 16 : nr->hops, nr->ticks);
|
||||
}
|
||||
}
|
||||
@ -209,7 +294,7 @@ void send_rip_broadcast(int mode)
|
||||
NW_NET_DEVICE *nd=net_devices[k];
|
||||
if (nd->ticks < 7) { /* isdn devices should not get RIP broadcasts everytime */
|
||||
init_rip_buff(nd->net, (mode == 2) ? 1 : 0);
|
||||
build_rip_buff(MAX_U32);
|
||||
build_rip_buff(MAX_U32, 0);
|
||||
send_rip_buff(NULL);
|
||||
}
|
||||
}
|
||||
@ -260,7 +345,7 @@ void handle_rip(int fd, int ipx_pack_typ,
|
||||
insert_delete_net(net, GET_BE32(from_addr->net),
|
||||
from_addr->node, hops+1, ticks+1, (hops > 15) ? 1 : 0);
|
||||
} else { /* rip request */
|
||||
build_rip_buff(net);
|
||||
build_rip_buff(net, GET_BE32(from_addr->net)==internal_net);
|
||||
if (net == MAX_U32) break;
|
||||
}
|
||||
p+=8;
|
||||
@ -281,42 +366,37 @@ void send_sap_broadcast(int mode)
|
||||
if (nd->ticks < 7 || mode) { /* isdn devices should not get SAP broadcasts everytime */
|
||||
IPX_DATA ipx_data;
|
||||
ipxAddr_t wild;
|
||||
int j=-1;
|
||||
memset(&wild, 0, sizeof(ipxAddr_t));
|
||||
|
||||
U32_TO_BE32(nd->net, wild.net);
|
||||
memset(wild.node, 0xFF, IPX_NODE_SIZE);
|
||||
U16_TO_BE16(SOCK_SAP, wild.sock);
|
||||
|
||||
memset(&ipx_data, 0, sizeof(ipx_data.sip));
|
||||
strcpy(ipx_data.sip.server_name, my_nwname);
|
||||
memcpy(&ipx_data.sip.server_adr, &my_server_adr, sizeof(ipxAddr_t));
|
||||
U16_TO_BE16(SOCK_NCP, ipx_data.sip.server_adr.sock);
|
||||
/* use NCP SOCKET */
|
||||
|
||||
U16_TO_BE16(2, ipx_data.sip.response_type); /* General */
|
||||
U16_TO_BE16(4, ipx_data.sip.server_type); /* Fileserver */
|
||||
|
||||
if (mode == 2) {
|
||||
U16_TO_BE16(16, ipx_data.sip.intermediate_networks);
|
||||
} else {
|
||||
U16_TO_BE16(1, ipx_data.sip.intermediate_networks);
|
||||
/* I hope 1 is ok here */
|
||||
while (++j < anz_servers) {
|
||||
NW_SERVERS *nw=nw_servers[j];
|
||||
if (!nw->typ || (nw->net == nd->net && nw->hops)) continue; /* no SAP to this NET */
|
||||
memset(&ipx_data, 0, sizeof(ipx_data.sip));
|
||||
strcpy(ipx_data.sip.server_name, nw->name);
|
||||
memcpy(&ipx_data.sip.server_adr, &(nw->addr), sizeof(ipxAddr_t));
|
||||
U16_TO_BE16(2, ipx_data.sip.response_type); /* General */
|
||||
U16_TO_BE16(nw->typ, ipx_data.sip.server_type); /* Fileserver */
|
||||
if (mode == 2) {
|
||||
U16_TO_BE16(16, ipx_data.sip.intermediate_networks);
|
||||
} else {
|
||||
U16_TO_BE16(nw->hops+1, ipx_data.sip.intermediate_networks);
|
||||
XDPRINTF((3, 0, "SEND SIP %s,0x%04x, hops=%d",
|
||||
nw->name, nw->typ, nw->hops+1));
|
||||
/* I hope 1 is ok here */
|
||||
}
|
||||
send_ipx_data(sockfd[SAP_SLOT],
|
||||
0,
|
||||
sizeof(ipx_data.sip),
|
||||
(char *)&(ipx_data.sip),
|
||||
&wild, "SIP Broadcast");
|
||||
}
|
||||
|
||||
#ifdef MY_BROADCAST_SLOT
|
||||
send_ipx_data(sockfd[MY_BROADCAST_SLOT],
|
||||
#else
|
||||
send_ipx_data(-1,
|
||||
#endif
|
||||
0,
|
||||
sizeof(ipx_data.sip),
|
||||
(char *)&(ipx_data.sip),
|
||||
&wild, "SIP Broadcast");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void query_sap_on_net(uint32 net)
|
||||
/* searches for the next server on this network */
|
||||
{
|
||||
@ -339,7 +419,8 @@ void get_servers(void)
|
||||
NW_NET_DEVICE *nd=net_devices[k];
|
||||
if (nd->ticks < 7) query_sap_on_net(nd->net); /* only fast routes */
|
||||
}
|
||||
if (!anz_net_devices) query_sap_on_net(internal_net);
|
||||
if (!anz_net_devices)
|
||||
query_sap_on_net(internal_net);
|
||||
}
|
||||
|
||||
|
||||
|
44
nwserv.c
44
nwserv.c
@ -28,9 +28,6 @@ int anz_net_devices=0;
|
||||
NW_NET_DEVICE *net_devices[MAX_NET_DEVICES];
|
||||
|
||||
uint16 ipx_sock_nummern[]={
|
||||
#ifdef MY_BROADCAST_SLOT
|
||||
0, /* auto sock */
|
||||
#endif
|
||||
#ifdef WDOG_SLOT
|
||||
0, /* auto sock */
|
||||
#endif
|
||||
@ -68,18 +65,7 @@ static int broadsecs = 2048;
|
||||
static time_t server_down_stamp = 0;
|
||||
static int server_goes_down_secs = 10;
|
||||
static int save_ipx_routes = 0;
|
||||
static int bytes_to_write_to_ncpserv = 0;
|
||||
|
||||
static void inform_ncpserv(void)
|
||||
{
|
||||
if (bytes_to_write_to_ncpserv && pid_ncpserv > -1) {
|
||||
#if 0
|
||||
XDPRINTF((2, 0,"inform_ncpserv bytes=%d", bytes_to_write_to_ncpserv));
|
||||
kill(pid_ncpserv, SIGHUP); /* tell ncpserv to read input */
|
||||
#endif
|
||||
bytes_to_write_to_ncpserv=0;
|
||||
}
|
||||
}
|
||||
|
||||
static void write_to_ncpserv(int what, int connection,
|
||||
char *data, int data_size)
|
||||
@ -89,40 +75,30 @@ static void write_to_ncpserv(int what, int connection,
|
||||
|
||||
switch (what) {
|
||||
case 0x5555 : /* kill connection */
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, (char*) &what, sizeof(int));
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, (char*) &connection, sizeof(int));
|
||||
break;
|
||||
|
||||
case 0x3333 : /* 'bindery' calls */
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, (char*) &what, sizeof(int));
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, (char*) &data_size, sizeof(int));
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, data, data_size);
|
||||
break;
|
||||
|
||||
case 0xeeee : /* hup, read init */
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, (char*) &what, sizeof(int));
|
||||
break;
|
||||
|
||||
case 0xffff : /* 'down server' */
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, (char*) &what, sizeof(int));
|
||||
bytes_to_write_to_ncpserv +=
|
||||
write(fd_ncpserv_out, (char*) &what, sizeof(int));
|
||||
inform_ncpserv();
|
||||
return;
|
||||
break;
|
||||
|
||||
default : break;
|
||||
}
|
||||
if (bytes_to_write_to_ncpserv > 255) inform_ncpserv();
|
||||
}
|
||||
|
||||
static void ins_del_bind_net_addr(char *name, ipxAddr_t *adr)
|
||||
void ins_del_bind_net_addr(char *name, ipxAddr_t *adr)
|
||||
{
|
||||
uint8 buf[1024];
|
||||
uint8 *p = buf;
|
||||
@ -389,7 +365,7 @@ void get_server_data(char *name,
|
||||
ipxAddr_t *adr,
|
||||
ipxAddr_t *from_addr)
|
||||
{
|
||||
if (!nw386_found) {
|
||||
if (!nw386_found && strcmp(name, my_nwname)) {
|
||||
memcpy(&nw386_adr, adr, sizeof(ipxAddr_t));
|
||||
nw386_found++;
|
||||
if (client_mode) {
|
||||
@ -398,7 +374,6 @@ void get_server_data(char *name,
|
||||
}
|
||||
}
|
||||
XDPRINTF((2,0,"NW386 %s found at:%s", name, visable_ipx_adr(adr)));
|
||||
ins_del_bind_net_addr(name, adr);
|
||||
}
|
||||
|
||||
static void handle_sap(int fd,
|
||||
@ -434,18 +409,21 @@ static void handle_sap(int fd,
|
||||
uint8 *name = p+2;
|
||||
ipxAddr_t *ad = (ipxAddr_t*) (p+50);
|
||||
int hops = GET_BE16(p+ sizeof(SAPS) -2);
|
||||
if (hops < 16) U16_TO_BE16(hops+1, p+ sizeof(SAPS) -2);
|
||||
XDPRINTF((2,0, "TYP=%2d,hops=%2d, Addr=%s, Name=%s", type, hops,
|
||||
visable_ipx_adr(ad), name));
|
||||
|
||||
if (type == 4 && strcmp(name, my_nwname)) { /* from Fileserver */
|
||||
if (type == 4) /* && strcmp(name, my_nwname)) */ { /* from Fileserver */
|
||||
if (16 == hops) {
|
||||
/* shutdown */
|
||||
XDPRINTF((2,0, "SERVER %s IS GOING DOWN", name));
|
||||
ins_del_bind_net_addr(name, NULL);
|
||||
insert_delete_server(name, type, NULL, NULL, 16, 1, 0);
|
||||
} else {
|
||||
get_server_data(name, ad, from_addr);
|
||||
insert_delete_server(name, type, ad, from_addr, hops, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
p+=sizeof(SAPS);
|
||||
} /* while */
|
||||
} else {
|
||||
@ -583,11 +561,6 @@ static void handle_event(int fd, uint16 socknr, int slot)
|
||||
IPXCMPNET (source_adr.net, my_server_adr.net)) {
|
||||
|
||||
int source_sock = (int) GET_BE16(source_adr.sock);
|
||||
|
||||
#if 0
|
||||
if ( source_sock == sock_nummern[MY_BROADCAST_SLOT]
|
||||
#endif
|
||||
|
||||
if ( source_sock == sock_nummern[WDOG_SLOT]
|
||||
|| source_sock == SOCK_SAP
|
||||
|| source_sock == SOCK_RIP) {
|
||||
@ -977,7 +950,6 @@ int main(int argc, char **argv)
|
||||
get_servers();
|
||||
broadsecs *= 2;
|
||||
}
|
||||
inform_ncpserv();
|
||||
send_wdogs();
|
||||
broadtime = akttime_stamp;
|
||||
} else if (client_mode) get_servers(); /* Here more often */
|
||||
|
17
nwserv.h
17
nwserv.h
@ -1,4 +1,4 @@
|
||||
/* nwserv.h 09-Jan-96 */
|
||||
/* nwserv.h 11-Jan-96 */
|
||||
/* (C)opyright (C) 1993,1995 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -33,10 +33,6 @@ extern int anz_net_devices;
|
||||
extern NW_NET_DEVICE *net_devices[];
|
||||
|
||||
/* <======== SOCKETS =========> */
|
||||
#if 0
|
||||
#define MY_BROADCAST_SLOT 0 /* Server Broadcast OUT */
|
||||
#endif
|
||||
|
||||
#define WDOG_SLOT 0 /* Watchdog send + recv */
|
||||
#define SAP_SLOT 1
|
||||
#define RIP_SLOT (SAP_SLOT +1)
|
||||
@ -49,6 +45,7 @@ extern NW_NET_DEVICE *net_devices[];
|
||||
|
||||
extern int sockfd[];
|
||||
|
||||
extern void ins_del_bind_net_addr(char *name, ipxAddr_t *adr);
|
||||
extern void send_rip_broadcast(int mode);
|
||||
extern void send_sap_broadcast(int mode);
|
||||
extern void rip_for_net(uint32 net);
|
||||
@ -58,3 +55,13 @@ extern void handle_rip(int fd, int ipx_pack_typ,
|
||||
int data_len, IPX_DATA *ipxdata,
|
||||
ipxAddr_t *from_addr);
|
||||
|
||||
|
||||
extern void insert_delete_server(uint8 *name,
|
||||
int styp,
|
||||
ipxAddr_t *addr,
|
||||
ipxAddr_t *from_addr,
|
||||
int hops,
|
||||
int do_delete, /* delete = 1 */
|
||||
int flags);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user