linux-decnet-commit Mailing List for DECnet for Linux (Page 19)
Brought to you by:
chrissie_c,
ph3-der-loewe
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(20) |
Feb
(27) |
Mar
(25) |
Apr
(12) |
May
(2) |
Jun
(6) |
Jul
(36) |
Aug
(12) |
Sep
(12) |
Oct
(16) |
Nov
(5) |
Dec
(5) |
| 2003 |
Jan
(8) |
Feb
(9) |
Mar
(25) |
Apr
(18) |
May
(29) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(10) |
Oct
(5) |
Nov
(3) |
Dec
(9) |
| 2004 |
Jan
(17) |
Feb
|
Mar
(9) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(2) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2005 |
Jan
(5) |
Feb
|
Mar
(13) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(13) |
Oct
(83) |
Nov
(2) |
Dec
|
| 2006 |
Jan
(21) |
Feb
(1) |
Mar
(32) |
Apr
(31) |
May
(3) |
Jun
(1) |
Jul
|
Aug
(7) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(13) |
| 2007 |
Jan
(1) |
Feb
(7) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
| 2008 |
Jan
(4) |
Feb
(13) |
Mar
(24) |
Apr
(18) |
May
(10) |
Jun
|
Jul
|
Aug
(40) |
Sep
(72) |
Oct
(61) |
Nov
(9) |
Dec
(2) |
| 2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
(3) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(41) |
Aug
(28) |
Sep
(2) |
Oct
(5) |
Nov
(4) |
Dec
|
| 2011 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Patrick C. <pa...@us...> - 2006-04-07 13:00:12
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26999 Modified Files: get_neigh.c Log Message: More info in debug messages Index: get_neigh.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/get_neigh.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** get_neigh.c 6 Apr 2006 10:46:52 -0000 1.11 --- get_neigh.c 7 Apr 2006 12:59:57 -0000 1.12 *************** *** 756,760 **** } ! debuglog("Level 1 routing message from %s len = %d\n", node, len); /* Look for nodes that are not in our neighbour list and add routes for them */ --- 756,760 ---- } ! debuglog("Level 1 routing message from %s on %s len = %d\n", node, if_index_to_name(iface), len); /* Look for nodes that are not in our neighbour list and add routes for them */ *************** *** 839,844 **** } ! debuglog("Level 2 routing message from %s(%d) len = %d\n", ! node, nodeaddr, len); /* In case we don't get a router hello in time, some nodes seem --- 839,844 ---- } ! debuglog("Level 2 routing message from %s(%d) on %s len = %d\n", ! node, nodeaddr, if_index_to_name(iface), len); /* In case we don't get a router hello in time, some nodes seem *************** *** 906,911 **** priority = buf[15]; ! debuglog("Got router hello from %d, level = %d, prio = %d\n", ! nodeaddr,level, priority); /* Add to (or update) neighbour hash */ --- 906,911 ---- priority = buf[15]; ! debuglog("Got router hello from %d on %s, level = %d, prio = %d\n", ! nodeaddr, if_index_to_name(iface), level, priority); /* Add to (or update) neighbour hash */ |
|
From: Patrick C. <pa...@us...> - 2006-04-06 12:46:34
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4444 Modified Files: send_route.c Log Message: Fix routing messages Index: send_route.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/send_route.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** send_route.c 6 Apr 2006 10:46:52 -0000 1.8 --- send_route.c 6 Apr 2006 12:46:25 -0000 1.9 *************** *** 63,68 **** i=0; ! packet[i++] = 0x9a; ! packet[i++] = 0x05; packet[i++] = type; --- 63,68 ---- i=0; ! packet[i++] = 0x00; /* Length, filled in at end */ ! packet[i++] = 0x00; packet[i++] = type; *************** *** 97,100 **** --- 97,103 ---- packet[i++] = sum >> 8; + packet[0] = (i-2) & 0xFF; + packet[1] = (i-2) >> 8; + /* Build the sockaddr_ll structure */ sock_info.sll_family = AF_PACKET; *************** *** 180,184 **** void send_level1_msg(struct routeinfo *node_table) { ! send_route_msg(0x07, node_table, 0, 1023); } --- 183,187 ---- void send_level1_msg(struct routeinfo *node_table) { ! send_route_msg(0x07, node_table, 0, 1024); } |
|
From: Patrick C. <pa...@us...> - 2006-04-06 10:47:16
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15826 Modified Files: get_neigh.c send_route.c Log Message: We don't need to split packets up into 32s...do we ? Index: get_neigh.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/get_neigh.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** get_neigh.c 5 Apr 2006 14:23:01 -0000 1.10 --- get_neigh.c 6 Apr 2006 10:46:52 -0000 1.11 *************** *** 1085,1089 **** { struct sockaddr_ll sll; ! int sll_len = sizeof(sll); len = recvfrom(dnet_socket, buf, sizeof(buf), 0, (struct sockaddr *)&sll, &sll_len); if (len > 0) --- 1085,1089 ---- { struct sockaddr_ll sll; ! unsigned int sll_len = sizeof(sll); len = recvfrom(dnet_socket, buf, sizeof(buf), 0, (struct sockaddr *)&sll, &sll_len); if (len > 0) Index: send_route.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/send_route.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** send_route.c 5 Apr 2006 14:23:01 -0000 1.7 --- send_route.c 6 Apr 2006 10:46:52 -0000 1.8 *************** *** 1,4 **** /* ! * dnroute.c DECnet routing daemon (eventually...) * * This program is free software; you can redistribute it and/or --- 1,4 ---- /* ! * send_route.c DECnet routing daemon * * This program is free software; you can redistribute it and/or *************** *** 8,12 **** * * Authors: Patrick Caulfield <pa...@de...> - * based on rtmon.c by Alexey Kuznetsov, <ku...@ms...> * */ --- 8,11 ---- *************** *** 60,65 **** int i,j; - assert (!((start-end) & 0x1F)); - fprintf(stderr,"Sending message type %d. start=%d, end=%d\n", type,start,end); --- 59,62 ---- *************** *** 74,87 **** packet[i++] = 0x00; /* Reserved */ ! /* Do the nodes in blocks of 32 */ for (j=start; j<end; j++) { - if ( !(j & 0x3F)) - { - packet[i++] = 32; - packet[i++] = 0; - packet[i++] = j&0xFF; - packet[i++] = j>>8; - } if (node_table[j].valid) { --- 71,83 ---- packet[i++] = 0x00; /* Reserved */ ! ! /* Header */ ! packet[i++] = (end-start) & 0xFF; ! packet[i++] = (end-start) >> 8; ! packet[i++] = start & 0xFF; ! packet[i++] = start >> 8; ! for (j=start; j<end; j++) { if (node_table[j].valid) { *************** *** 126,130 **** } ! static void send_route_msg(unsigned char type, struct routeinfo *node_table, int num) { struct ifreq ifr; --- 122,126 ---- } ! static void send_route_msg(unsigned char type, struct routeinfo *node_table, int start, int num) { struct ifreq ifr; *************** *** 153,157 **** int num_nodes; ! last_node = 0; ioctl(sock, SIOCGIFMTU, &ifr); --- 149,153 ---- int num_nodes; ! last_node = start; ioctl(sock, SIOCGIFMTU, &ifr); *************** *** 184,192 **** void send_level1_msg(struct routeinfo *node_table) { ! send_route_msg(0x07, node_table, 1024); } void send_level2_msg(struct routeinfo *area_table) { ! send_route_msg(0x09, area_table, 64); } --- 180,188 ---- void send_level1_msg(struct routeinfo *node_table) { ! send_route_msg(0x07, node_table, 0, 1023); } void send_level2_msg(struct routeinfo *area_table) { ! send_route_msg(0x09, area_table, 1, 64); } |
|
From: Patrick C. <pa...@us...> - 2006-04-05 14:23:12
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29584 Modified Files: get_neigh.c send_route.c Log Message: Fix send_route() so it sends valid messages. We were not showing nodes in the same area behind routers Index: get_neigh.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/get_neigh.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** get_neigh.c 5 Apr 2006 10:32:59 -0000 1.9 --- get_neigh.c 5 Apr 2006 14:23:01 -0000 1.10 *************** *** 251,255 **** addr = exec_addr->a_addr[1] << 8 | i; n = dm_hash_lookup_binary(node_hash, (void *)&addr, 2); ! if (!n || n->deleted) continue; --- 251,255 ---- addr = exec_addr->a_addr[1] << 8 | i; n = dm_hash_lookup_binary(node_hash, (void *)&addr, 2); ! if (n && n->deleted) continue; *************** *** 766,769 **** --- 766,770 ---- start_id = buf[i] | buf[i+1]<<8; i+=2; /* Start of entries */ + debuglog("PJC start_id = %d, num_ids = %d pos=%d\n", start_id, num_ids, i); for (num = 0; num<num_ids; num++) Index: send_route.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/send_route.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** send_route.c 5 Apr 2006 07:17:44 -0000 1.6 --- send_route.c 5 Apr 2006 14:23:01 -0000 1.7 *************** *** 60,64 **** int i,j; ! assert (!((start-end) & 0x3F)); fprintf(stderr,"Sending message type %d. start=%d, end=%d\n", type,start,end); --- 60,64 ---- int i,j; ! assert (!((start-end) & 0x1F)); fprintf(stderr,"Sending message type %d. start=%d, end=%d\n", type,start,end); |
|
From: Patrick C. <pa...@us...> - 2006-04-05 10:34:12
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19553 Removed Files: dn_rtmsg.c Log Message: Remove redundant file --- dn_rtmsg.c DELETED --- |
|
From: Patrick C. <pa...@us...> - 2006-04-05 10:33:14
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18831 Modified Files: get_neigh.c Log Message: Don't show nodes that have been removed, sigh. Index: get_neigh.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/get_neigh.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** get_neigh.c 5 Apr 2006 08:13:24 -0000 1.8 --- get_neigh.c 5 Apr 2006 10:32:59 -0000 1.9 *************** *** 249,259 **** int interface = 0; - if (first) - { - first = 0; - fprintf(fp, " Node Cost Hops Next hop to node\n"); - } addr = exec_addr->a_addr[1] << 8 | i; n = dm_hash_lookup_binary(node_hash, (void *)&addr, 2); dn_addr[0] = addr & 0xFF; dn_addr[1] = addr>>8; --- 249,257 ---- int interface = 0; addr = exec_addr->a_addr[1] << 8 | i; n = dm_hash_lookup_binary(node_hash, (void *)&addr, 2); + if (!n || n->deleted) + continue; + dn_addr[0] = addr & 0xFF; dn_addr[1] = addr>>8; *************** *** 285,288 **** --- 283,292 ---- } + if (first) + { + first = 0; + fprintf(fp, " Node Cost Hops Next hop to node\n"); + } + fprintf(fp, " %2d.%-3d %-12s %3d %3d %-5s -> %2d.%-3d %-12s\n", exec_addr->a_addr[1]>>2, i, |
|
From: Patrick C. <pa...@us...> - 2006-04-05 09:14:22
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24101 Modified Files: rpm.spec Log Message: Include dnetinfo in the RPM Index: rpm.spec =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/rpm.spec,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** rpm.spec 30 Mar 2006 07:56:11 -0000 1.11 --- rpm.spec 5 Apr 2006 09:14:13 -0000 1.12 *************** *** 35,38 **** --- 35,39 ---- %%PREFIX%%/sbin/fal %%PREFIX%%/sbin/dnroute + %%PREFIX%%/sbin/dnetinfo %%PREFIX%%/sbin/startnet %%PREFIX%%/sbin/decnetconf *************** *** 74,77 **** --- 75,79 ---- %%PREFIX%%/man/man8/fal.8 %%PREFIX%%/man/man8/dnroute.8 + %%PREFIX%%/man/man8/dnetinfo.8 %%PREFIX%%/man/man8/phoned.8 %%PREFIX%%/man/man8/dnetd.8 |
|
From: Patrick C. <pa...@us...> - 2006-04-05 09:12:21
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22624 Modified Files: Makefile.common Log Message: bump version number Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** Makefile.common 16 Mar 2006 14:55:22 -0000 1.34 --- Makefile.common 5 Apr 2006 09:12:07 -0000 1.35 *************** *** 58,62 **** MAJOR_VERSION=2 ! MINOR_VERSION=34 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) --- 58,62 ---- MAJOR_VERSION=2 ! MINOR_VERSION=35 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) |
|
From: Patrick C. <pa...@us...> - 2006-04-05 09:06:22
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18304/debian Modified Files: dnet-common.README Log Message: Fix typo Index: dnet-common.README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-common.README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dnet-common.README 5 Apr 2006 07:21:46 -0000 1.2 --- dnet-common.README 5 Apr 2006 09:06:17 -0000 1.3 *************** *** 6,10 **** http://linux-decnet.sourceforge.net ! Configuration can be done by editting /etc/defaults/decnet, several environment variables can be set: --- 6,10 ---- http://linux-decnet.sourceforge.net ! Configuration can be done by editing /etc/defaults/decnet, several environment variables can be set: *************** *** 21,22 **** --- 21,23 ---- <daemon>_FLAGS: flags to add when starting <daemon> eg dnroute_FLAGS="-v" + |
|
From: Patrick C. <pa...@us...> - 2006-04-05 09:03:15
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/debian Modified Files: changelog dnet-common.init.d dnet-progs.init.d Log Message: Tweak init scripts Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** changelog 5 Apr 2006 08:52:00 -0000 1.39 --- changelog 5 Apr 2006 09:02:56 -0000 1.40 *************** *** 12,15 **** --- 12,16 ---- "that doesn't look quite right" things. It also works with GNV's bash too! * Add multinet IP tunnelling daemon + * Some minor fixes to init scripts -- Patrick Caulfield <pa...@de...> Wed, 5 Apr 2006 09:39:04 +0100 Index: dnet-common.init.d =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-common.init.d,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** dnet-common.init.d 6 May 2003 09:57:57 -0000 1.7 --- dnet-common.init.d 5 Apr 2006 09:02:56 -0000 1.8 *************** *** 50,57 **** fi ! for i in /proc/sys/net/decnet/conf/eth* do ! echo $1 > $i/forwarding ! echo $PRIORITY > $i/priority done fi --- 50,57 ---- fi ! for i in /proc/sys/net/decnet/conf/eth[0-9]* do ! echo "$1" > $i/forwarding ! echo "$PRIORITY" > $i/priority done fi Index: dnet-progs.init.d =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.init.d,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** dnet-progs.init.d 5 Apr 2006 07:21:46 -0000 1.9 --- dnet-progs.init.d 5 Apr 2006 09:02:56 -0000 1.10 *************** *** 31,35 **** echo -n " $i" eval "flags=\$${i}_FLAGS" ! start-stop-daemon --start --quiet --exec /usr/sbin/$i $flags fi done --- 31,35 ---- echo -n " $i" eval "flags=\$${i}_FLAGS" ! start-stop-daemon --start --quiet --exec /usr/sbin/$i -- $flags fi done |
|
From: Patrick C. <pa...@us...> - 2006-04-05 08:52:10
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7875/debian Modified Files: changelog Log Message: Minor tidying for 2.35 release Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** changelog 5 Apr 2006 07:21:46 -0000 1.38 --- changelog 5 Apr 2006 08:52:00 -0000 1.39 *************** *** 5,15 **** * dnroute now sends level2 router messages and creates area routing tables from those it receives ! * Add script 'dnetinfo' to query the routing daemon * libdnet: Fix getnodebyaddr so it works with high node numbers. * Make ncurses phone work on big-endian machines * Better newline handling in dnlogin. This should fix those niggling "that doesn't look quite right" things. It also works with GNV's bash too! ! * Add multinet IP tunnelling daemon. dnprogs (2.34) unstable; urgency=low --- 5,17 ---- * dnroute now sends level2 router messages and creates area routing tables from those it receives ! * Add script 'dnetinfo' to query the routing daemon state - the ! output emulates SHOW NET/OLD * libdnet: Fix getnodebyaddr so it works with high node numbers. * Make ncurses phone work on big-endian machines * Better newline handling in dnlogin. This should fix those niggling "that doesn't look quite right" things. It also works with GNV's bash too! ! * Add multinet IP tunnelling daemon + -- Patrick Caulfield <pa...@de...> Wed, 5 Apr 2006 09:39:04 +0100 dnprogs (2.34) unstable; urgency=low |
|
From: Patrick C. <pa...@us...> - 2006-04-05 08:52:07
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7875 Modified Files: Makefile Log Message: Minor tidying for 2.35 release Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** Makefile 27 Oct 2005 12:31:26 -0000 1.26 --- Makefile 5 Apr 2006 08:51:58 -0000 1.27 *************** *** 10,14 **** SUBDIRS=include libdnet libdaemon libdap librms fal dndir dnsubmit dndel \ ! dncopy apps dntask dnlogin mail phone dnetd libvaxdata dnroute scripts all: --- 10,15 ---- SUBDIRS=include libdnet libdaemon libdap librms fal dndir dnsubmit dndel \ ! dncopy apps dntask dnlogin mail phone dnetd libvaxdata dnroute \ ! multinet scripts all: |
|
From: Patrick C. <pa...@us...> - 2006-04-05 08:52:07
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7875/dnroute Modified Files: Makefile Log Message: Minor tidying for 2.35 release Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** Makefile 5 Apr 2006 07:17:44 -0000 1.8 --- Makefile 5 Apr 2006 08:52:00 -0000 1.9 *************** *** 17,21 **** install -d $(manprefix)/man/man8 install -m 0755 -s dnroute $(prefix)/sbin ! install -m 0755 -s dnetinfo.sh $(prefix)/sbin/dnetinfo install -m 0644 dnroute.8 $(manprefix)/man/man8 install -m 0644 dnetinfo.8 $(manprefix)/man/man8 --- 17,21 ---- install -d $(manprefix)/man/man8 install -m 0755 -s dnroute $(prefix)/sbin ! install -m 0755 dnetinfo.sh $(prefix)/sbin/dnetinfo install -m 0644 dnroute.8 $(manprefix)/man/man8 install -m 0644 dnetinfo.8 $(manprefix)/man/man8 |
|
From: Patrick C. <pa...@us...> - 2006-04-05 08:13:29
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10510 Modified Files: get_neigh.c Log Message: Show the device for a node-router. cope better with machines that have two NICS on one ethernet Index: get_neigh.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/get_neigh.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** get_neigh.c 5 Apr 2006 07:17:44 -0000 1.7 --- get_neigh.c 5 Apr 2006 08:13:24 -0000 1.8 *************** *** 247,250 **** --- 247,251 ---- char *routername = NULL; unsigned short router; + int interface = 0; if (first) *************** *** 261,266 **** --- 262,270 ---- nodename = strdup(ne->n_name); + /* Is this node behind a level 1 router ? */ if (node_table[i].router) { + struct nodeinfo *rn; + router = node_table[i].router; dn_addr[0] = router & 0xFF; *************** *** 269,272 **** --- 273,279 ---- if (ne) routername = strdup(ne->n_name); + rn = dm_hash_lookup_binary(node_hash, (void *)&router, 2); + if (rn) + interface = rn->interface; } else *************** *** 274,277 **** --- 281,286 ---- router = exec_addr->a_addr[1] << 8 | i; routername = nodename; + if (n) + interface = n->interface; } *************** *** 280,284 **** nodename?nodename:"", node_table[i].cost, node_table[i].hops, ! n?if_index_to_name(n->interface):"????", router>>10, router & 0x3FF, routername?routername:""); --- 289,293 ---- nodename?nodename:"", node_table[i].cost, node_table[i].hops, ! if_index_to_name(interface), router>>10, router & 0x3FF, routername?routername:""); *************** *** 563,566 **** --- 572,580 ---- area, node, if_index_to_name(interface), interface, n?n->interface:0); + /* If this node has already been scanned then ignore it. + This can happen if a node has two NICS on one ethernet + and we don't want routes to flip-flop */ + if (n && n->scanned) + return 0; /* If it's not there or the interface has changed then |
|
From: Patrick C. <pa...@us...> - 2006-04-05 07:36:17
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13381 Added Files: dnroute.h Log Message: Missing header file --- NEW FILE: dnroute.h --- struct routeinfo { struct routeinfo *next; /* List of routes to this node/area */ unsigned short cost; unsigned short hops; unsigned short router; unsigned char valid; unsigned char manual; unsigned char priority; }; |
|
From: Patrick C. <pa...@us...> - 2006-04-05 07:21:54
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2478 Modified Files: changelog dnet-common.README dnet-progs.files dnet-progs.init.d rules Log Message: Incorporate new stuff Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** changelog 16 Mar 2006 14:55:22 -0000 1.37 --- changelog 5 Apr 2006 07:21:46 -0000 1.38 *************** *** 1,2 **** --- 1,16 ---- + dnprogs (2.35) unstable; urgency=low + + * Make dnroute work on big-endian machines + * dnroute can now send router messages on devices with small MTUs + * dnroute now sends level2 router messages and creates area + routing tables from those it receives + * Add script 'dnetinfo' to query the routing daemon + * libdnet: Fix getnodebyaddr so it works with high node numbers. + * Make ncurses phone work on big-endian machines + * Better newline handling in dnlogin. This should fix those niggling + "that doesn't look quite right" things. It also works with GNV's bash too! + * Add multinet IP tunnelling daemon. + + dnprogs (2.34) unstable; urgency=low Index: dnet-common.README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-common.README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnet-common.README 26 Sep 2003 08:01:43 -0000 1.1 --- dnet-common.README 5 Apr 2006 07:21:46 -0000 1.2 *************** *** 5,6 **** --- 5,22 ---- http://linux-decnet.sourceforge.net + + Configuration can be done by editting /etc/defaults/decnet, several environment + variables can be set: + + DNET_INTERFACES: List if ethernet interfaces to enable for DECnet, This sets + the MAC address of these interfaces to the DECnet address in /etc/decnet.conf. + The first interface will be set as the default interface for DECnet + communications. + + DNET_DAEMONS: List of daemons to start. dnetd a DECnet "super-server" that + will start other daemons on deman. But you can put things like fal in here too. + + ROUTING: Enable routing at level <n> + PRIORITY: Router priority + <daemon>_FLAGS: flags to add when starting <daemon> + eg dnroute_FLAGS="-v" Index: dnet-progs.files =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.files,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dnet-progs.files 30 Mar 2006 07:56:11 -0000 1.5 --- dnet-progs.files 5 Apr 2006 07:21:46 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- ./usr/sbin/dnetd ./usr/sbin/dnroute + ./usr/sbin/dnetinfo ./usr/sbin/multinet ./usr/bin/dndir *************** *** 31,34 **** --- 32,36 ---- ./usr/share/man/man8/vmsmaild.8 ./usr/share/man/man8/dnroute.8 + ./usr/share/man/man8/dnetinfo.8 ./usr/share/man/man8/multinet.8 ./usr/share/man/man5/vmsmail.conf.5 Index: dnet-progs.init.d =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.init.d,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** dnet-progs.init.d 6 May 2003 09:57:57 -0000 1.8 --- dnet-progs.init.d 5 Apr 2006 07:21:46 -0000 1.9 *************** *** 30,34 **** then echo -n " $i" ! start-stop-daemon --start --quiet --exec /usr/sbin/$i fi done --- 30,35 ---- then echo -n " $i" ! eval "flags=\$${i}_FLAGS" ! start-stop-daemon --start --quiet --exec /usr/sbin/$i $flags fi done *************** *** 55,60 **** do echo -n " $i" start-stop-daemon --stop --quiet --exec /usr/sbin/$i ! start-stop-daemon --start --quiet --exec /usr/sbin/$i done echo "." --- 56,62 ---- do echo -n " $i" + eval "flags=\$${i}_FLAGS" start-stop-daemon --stop --quiet --exec /usr/sbin/$i ! start-stop-daemon --start --quiet --exec /usr/sbin/$i $flags done echo "." Index: rules =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/rules,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** rules 30 Oct 2005 15:21:51 -0000 1.20 --- rules 5 Apr 2006 07:21:46 -0000 1.21 *************** *** 27,32 **** echo "DNET_INTERFACES=\"all\"" >> debian/tmp/etc/default/decnet echo '# DNET_DAEMONS lists the daemons to start when dnet-progs is installed.' >> debian/tmp/etc/default/decnet - echo "DNET_DAEMONS=\"dnetd phoned #dnroute\"" >> debian/tmp/etc/default/decnet echo "#" >> debian/tmp/etc/default/decnet echo "# The following two lines enable routing, note that if you are" >> debian/tmp/etc/default/decnet echo "# being a router, then add dnroute to the DNET_DAEMONS too" >> debian/tmp/etc/default/decnet --- 27,33 ---- echo "DNET_INTERFACES=\"all\"" >> debian/tmp/etc/default/decnet echo '# DNET_DAEMONS lists the daemons to start when dnet-progs is installed.' >> debian/tmp/etc/default/decnet echo "#" >> debian/tmp/etc/default/decnet + echo "DNET_DAEMONS=\"dnetd phoned\"" >> debian/tmp/etc/default/decnet + echo "dnroute_FLAGS=\"-v -2\"" >> debian/tmp/etc/default/decnet echo "# The following two lines enable routing, note that if you are" >> debian/tmp/etc/default/decnet echo "# being a router, then add dnroute to the DNET_DAEMONS too" >> debian/tmp/etc/default/decnet *************** *** 39,43 **** make install DESTDIR=`pwd`/debian/tmp MAKEDEB=true RELEASE=true mv debian/tmp/usr/man debian/tmp/usr/share ! rm debian/tmp/usr/sbin/startnet install -m755 apps/setether.sh debian/tmp/sbin/setether dh_installdirs -pdnet-common --- 40,44 ---- make install DESTDIR=`pwd`/debian/tmp MAKEDEB=true RELEASE=true mv debian/tmp/usr/man debian/tmp/usr/share ! rm -f debian/tmp/usr/sbin/startnet install -m755 apps/setether.sh debian/tmp/sbin/setether dh_installdirs -pdnet-common |
|
From: Patrick C. <pa...@us...> - 2006-04-05 07:20:56
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1700 Modified Files: multinet.c Log Message: Allow multiple servers to run at once (I think) Index: multinet.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/multinet/multinet.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** multinet.c 29 Mar 2006 16:25:02 -0000 1.6 --- multinet.c 5 Apr 2006 07:20:47 -0000 1.7 *************** *** 237,240 **** --- 237,241 ---- { int fd; + int flag = 1; struct sockaddr_in sin; *************** *** 243,246 **** --- 244,250 ---- return -1; + + setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&flag, sizeof(flag)); + sin.sin_family = AF_INET; sin.sin_port = htons(port); *************** *** 271,278 **** unsigned char buf[1600]; int len; ! len = read(ipfd, buf, sizeof(buf)); if (len <= 0) return; last_ip_packet = time(NULL); --- 275,289 ---- unsigned char buf[1600]; int len; + struct sockaddr_in sin; + unsigned int sinlen = sizeof(sin); ! len = recvfrom(ipfd, buf, sizeof(buf), 0, (struct sockaddr *)&sin, &sinlen); if (len <= 0) return; + /* Ignore packets from people we're not talking to */ + if (sin.sin_port != remote_addr.sin_port || + sin.sin_addr.s_addr != remote_addr.sin_addr.s_addr) + return; + last_ip_packet = time(NULL); |
|
From: Patrick C. <pa...@us...> - 2006-04-05 07:19:26
|
Update of /cvsroot/linux-decnet/dnprogs/libdnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv414 Modified Files: getnodebyaddr.c Log Message: Fix bug that prevented nodes with large node numbes from working Index: getnodebyaddr.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/libdnet/getnodebyaddr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** getnodebyaddr.c 22 Dec 2000 10:55:28 -0000 1.3 --- getnodebyaddr.c 5 Apr 2006 07:19:11 -0000 1.4 *************** *** 30,40 **** static char laddr[2]; ! struct nodeent *getnodebyaddr(const char *addr, int len, int family) { FILE *dnhosts; char nodeln[80]; ! sprintf (asc_addr,"%d.%d",((char)*(addr+1) >> 2), ! (((char)*(addr+1) & 0x03) << 8) | ((char)*(addr)) ); --- 30,41 ---- static char laddr[2]; ! struct nodeent *getnodebyaddr(const char *inaddr, int len, int family) { FILE *dnhosts; char nodeln[80]; + const unsigned char *addr = (const unsigned char *)inaddr; ! sprintf (asc_addr,"%d.%d",((unsigned char)*(addr+1) >> 2), ! (((unsigned char)*(addr+1) & 0x03) << 8) | ((unsigned char)*(addr)) ); |
|
From: Patrick C. <pa...@us...> - 2006-04-05 07:18:11
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31934 Modified Files: Makefile README TODO csum.c dnroute.8 get_neigh.c routing_msg.c send_route.c Added Files: dnetinfo.8 dnetinfo.sh dnroute.conf.sample hash.c hash.h Log Message: A lot can happen while SF's CVS server is down :) --- NEW FILE: dnetinfo.8 --- .TH DNETINFO 8 "March 30 2006" "DECnet utilities" .SH NAME dnetinfo \- DECnet Routing Information .SH SYNOPSIS .B dnetinfo [-l] .SH DESCRIPTION .PP .B dnetinfo is a shell script that queries the dnroute daemon for it's current routes. The output is very similar to the "SHOW NET/OLD" command on VMS. .SH OPTIONS .TP .I "\-l" Displays only local neighbour information. This is the default if dnroute is not running. .SH SEE ALSO .BR dnroute "(8), " ip "(8)" --- NEW FILE: dnetinfo.sh --- #!/bin/sh # # Quick & dirty shell script to query dnetd for the # node routing status. # # If that's not available then show the current neighbour table. # # These bizarre awk-isms are to cope with different versions of awk, sigh show_all() { awk '{ if (ARGIND == 1 || FILENAME == "/etc/decnet.conf") node[$2] = $4;\ if (ARGIND == 2 || FILENAME == "/proc/net/decnet_neigh") printf "%-10s %-12s %s\n", $1, node[$1], $6}' \ /etc/decnet.conf /proc/net/decnet_neigh | sort -g } if [ "$1" = "-n" ] then show_all exit 0 fi killall -USR1 dnroute 2>/dev/null if [ "$?" = "0" ] then cat /var/run/dnroute.status else show_all fi --- NEW FILE: dnroute.conf.sample --- # Example dnroute config file # Uncomment this to send level 2 routing messages. or run with -2 # level 2 # Uncomment this to prevent dnrout from automatically setting routes for area 3 # manual 3 # By default, all interfaces have a cost of 4, you can change that here. # eg. a multinet link might need a much higher cost than local ethernet. # eth0 6 # tap0 10 --- NEW FILE: hash.c --- /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. * * This file is part of the device-mapper userspace tools. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License v.2. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <sys/types.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #define dm_malloc malloc #define dm_free free typedef void (*dm_hash_iterate_fn) (void *data); struct dm_hash_node { struct dm_hash_node *next; void *data; unsigned keylen; char key[0]; }; struct dm_hash_table { unsigned num_nodes; unsigned num_slots; struct dm_hash_node **slots; }; /* Permutation of the Integers 0 through 255 */ static unsigned char _nums[] = { 1, 14, 110, 25, 97, 174, 132, 119, 138, 170, 125, 118, 27, 233, 140, 51, 87, 197, 177, 107, 234, 169, 56, 68, 30, 7, 173, 73, 188, 40, 36, 65, 49, 213, 104, 190, 57, 211, 148, 223, 48, 115, 15, 2, 67, 186, 210, 28, 12, 181, 103, 70, 22, 58, 75, 78, 183, 167, 238, 157, 124, 147, 172, 144, 176, 161, 141, 86, 60, 66, 128, 83, 156, 241, 79, 46, 168, 198, 41, 254, 178, 85, 253, 237, 250, 154, 133, 88, 35, 206, 95, 116, 252, 192, 54, 221, 102, 218, 255, 240, 82, 106, 158, 201, 61, 3, 89, 9, 42, 155, 159, 93, 166, 80, 50, 34, 175, 195, 100, 99, 26, 150, 16, 145, 4, 33, 8, 189, 121, 64, 77, 72, 208, 245, 130, 122, 143, 55, 105, 134, 29, 164, 185, 194, 193, 239, 101, 242, 5, 171, 126, 11, 74, 59, 137, 228, 108, 191, 232, 139, 6, 24, 81, 20, 127, 17, 91, 92, 251, 151, 225, 207, 21, 98, 113, 112, 84, 226, 18, 214, 199, 187, 13, 32, 94, 220, 224, 212, 247, 204, 196, 43, 249, 236, 45, 244, 111, 182, 153, 136, 129, 90, 217, 202, 19, 165, 231, 71, 230, 142, 96, 227, 62, 179, 246, 114, 162, 53, 160, 215, 205, 180, 47, 109, 44, 38, 31, 149, 135, 0, 216, 52, 63, 23, 37, 69, 39, 117, 146, 184, 163, 200, 222, 235, 248, 243, 219, 10, 152, 131, 123, 229, 203, 76, 120, 209 }; static struct dm_hash_node *_create_node(const char *str, unsigned len) { struct dm_hash_node *n = dm_malloc(sizeof(*n) + len); if (n) { memcpy(n->key, str, len); n->keylen = len; } return n; } static unsigned long _hash(const unsigned char *str, unsigned len) { unsigned long h = 0, g; unsigned i; for (i = 0; i < len; i++) { h <<= 4; h += _nums[*str++]; g = h & ((unsigned long) 0xf << 16u); if (g) { h ^= g >> 16u; h ^= g >> 5u; } } return h; } struct dm_hash_table *dm_hash_create(unsigned size_hint) { size_t len; unsigned new_size = 16u; struct dm_hash_table *hc = dm_malloc(sizeof(*hc)); if (!hc) { return 0; } memset(hc, 0, sizeof(*hc)); /* round size hint up to a power of two */ while (new_size < size_hint) new_size = new_size << 1; hc->num_slots = new_size; len = sizeof(*(hc->slots)) * new_size; if (!(hc->slots = dm_malloc(len))) { goto bad; } memset(hc->slots, 0, len); return hc; bad: dm_free(hc->slots); dm_free(hc); return 0; } static void _free_nodes(struct dm_hash_table *t) { struct dm_hash_node *c, *n; unsigned i; for (i = 0; i < t->num_slots; i++) for (c = t->slots[i]; c; c = n) { n = c->next; dm_free(c); } } void dm_hash_destroy(struct dm_hash_table *t) { _free_nodes(t); dm_free(t->slots); dm_free(t); } static struct dm_hash_node **_find(struct dm_hash_table *t, const char *key, uint32_t len) { unsigned h = _hash((unsigned char*)key, len) & (t->num_slots - 1); struct dm_hash_node **c; for (c = &t->slots[h]; *c; c = &((*c)->next)) if (!memcmp(key, (*c)->key, len)) break; return c; } void *dm_hash_lookup_binary(struct dm_hash_table *t, const char *key, uint32_t len) { struct dm_hash_node **c = _find(t, key, len); return *c ? (*c)->data : 0; } int dm_hash_insert_binary(struct dm_hash_table *t, const char *key, uint32_t len, void *data) { struct dm_hash_node **c = _find(t, key, len); if (*c) (*c)->data = data; else { struct dm_hash_node *n = _create_node(key, len); if (!n) return 0; n->data = data; n->next = 0; *c = n; t->num_nodes++; } return 1; } void dm_hash_remove_binary(struct dm_hash_table *t, const char *key, uint32_t len) { struct dm_hash_node **c = _find(t, key, len); if (*c) { struct dm_hash_node *old = *c; *c = (*c)->next; dm_free(old); t->num_nodes--; } } void *dm_hash_lookup(struct dm_hash_table *t, const char *key) { return dm_hash_lookup_binary(t, key, strlen(key) + 1); } int dm_hash_insert(struct dm_hash_table *t, const char *key, void *data) { return dm_hash_insert_binary(t, key, strlen(key) + 1, data); } void dm_hash_remove(struct dm_hash_table *t, const char *key) { dm_hash_remove_binary(t, key, strlen(key) + 1); } unsigned dm_hash_get_num_entries(struct dm_hash_table *t) { return t->num_nodes; } void dm_hash_iter(struct dm_hash_table *t, dm_hash_iterate_fn f) { struct dm_hash_node *c; unsigned i; for (i = 0; i < t->num_slots; i++) for (c = t->slots[i]; c; c = c->next) f(c->data); } void dm_hash_wipe(struct dm_hash_table *t) { _free_nodes(t); memset(t->slots, 0, sizeof(struct dm_hash_node *) * t->num_slots); t->num_nodes = 0u; } char *dm_hash_get_key(struct dm_hash_table *t, struct dm_hash_node *n) { return n->key; } void *dm_hash_get_data(struct dm_hash_table *t, struct dm_hash_node *n) { return n->data; } static struct dm_hash_node *_next_slot(struct dm_hash_table *t, unsigned s) { struct dm_hash_node *c = NULL; unsigned i; for (i = s; i < t->num_slots && !c; i++) c = t->slots[i]; return c; } struct dm_hash_node *dm_hash_get_first(struct dm_hash_table *t) { return _next_slot(t, 0); } struct dm_hash_node *dm_hash_get_next(struct dm_hash_table *t, struct dm_hash_node *n) { unsigned h = _hash((unsigned char *)n->key, n->keylen) & (t->num_slots - 1); return n->next ? n->next : _next_slot(t, h + 1); } --- NEW FILE: hash.h --- /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. * * This file is part of the device-mapper userspace tools. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License v.2. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _LVM_HASH_H #define _LVM_HASH_H struct dm_hash_table; struct dm_hash_node; typedef void (*dm_hash_iterate_fn) (void *data); struct dm_hash_table *dm_hash_create(unsigned size_hint); void dm_hash_destroy(struct dm_hash_table *t); void dm_hash_wipe(struct dm_hash_table *t); void *dm_hash_lookup(struct dm_hash_table *t, const char *key); int dm_hash_insert(struct dm_hash_table *t, const char *key, void *data); void dm_hash_remove(struct dm_hash_table *t, const char *key); void *dm_hash_lookup_binary(struct dm_hash_table *t, const char *key, uint32_t len); int dm_hash_insert_binary(struct dm_hash_table *t, const char *key, uint32_t len, void *data); void dm_hash_remove_binary(struct dm_hash_table *t, const char *key, uint32_t len); unsigned dm_hash_get_num_entries(struct dm_hash_table *t); void dm_hash_iter(struct dm_hash_table *t, dm_hash_iterate_fn f); char *dm_hash_get_key(struct dm_hash_table *t, struct dm_hash_node *n); void *dm_hash_get_data(struct dm_hash_table *t, struct dm_hash_node *n); struct dm_hash_node *dm_hash_get_first(struct dm_hash_table *t); struct dm_hash_node *dm_hash_get_next(struct dm_hash_table *t, struct dm_hash_node *n); #define dm_hash_iterate(v, h) \ for (v = dm_hash_get_first(h); v; \ v = dm_hash_get_next(h, v)) #endif Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Makefile 12 Aug 2004 09:17:33 -0000 1.7 --- Makefile 5 Apr 2006 07:17:44 -0000 1.8 *************** *** 7,11 **** all: $(DNROUTE) ! $(DNROUTE): get_neigh.c send_route.c routing_msg.c csum.c netlink/libnetlink.a $(CC) $(CFLAGS) -o $@ $^ -L../libdnet -Lnetlink -ldnet -lnetlink --- 7,11 ---- all: $(DNROUTE) ! $(DNROUTE): get_neigh.c send_route.c routing_msg.c csum.c hash.c netlink/libnetlink.a $(CC) $(CFLAGS) -o $@ $^ -L../libdnet -Lnetlink -ldnet -lnetlink *************** *** 17,21 **** --- 17,23 ---- install -d $(manprefix)/man/man8 install -m 0755 -s dnroute $(prefix)/sbin + install -m 0755 -s dnetinfo.sh $(prefix)/sbin/dnetinfo install -m 0644 dnroute.8 $(manprefix)/man/man8 + install -m 0644 dnetinfo.8 $(manprefix)/man/man8 clean: Index: README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** README 18 Apr 2002 09:07:56 -0000 1.2 --- README 5 Apr 2006 07:17:44 -0000 1.3 *************** *** 1,13 **** ! This is dnroute - the DECnet routing daemon - it is not finished yet. What it will do is to send out level 1 routing messages containing the local neighbour information for this node. If you enable routing for your kernel then this daemon will make it look as though it can ! route DECnet packets to other DECnet nodes. ! You will need Alexey Kuznetsov's iproute2 sources to build this software - ! it is not automatically built as part of the dnprogs package. If it is ! installed in /usr/local/src/iproute2 then dnroute should build, otherwise ! you will need to change the Makefile. If you want to test DECnet routing please contact myself (patrick) or Steve --- 1,18 ---- ! This is dnroute - the DECnet routing daemon What it will do is to send out level 1 routing messages containing the local neighbour information for this node. If you enable routing for your kernel then this daemon will make it look as though it can ! route DECnet packets to other DECnet nodes. It will also, optionally, ! send level2 routing messages showing which other areas can be seen. ! It also sets up area routes to remote areas that are seen via these messages ! and ajusts those routes according to the relative cost of each route. The ! router priority is NOT currrently taken into account cos it's not currently ! available to userspace, but the cost bit seems to work pretty well. ! Use the ip command to show the routes set up by the daemon and report any ! problems. ! ! ip -D route If you want to test DECnet routing please contact myself (patrick) or Steve *************** *** 15,19 **** NOTES: - insert the :grabulator: module dn_rtmsg.o echo "1" into /proc/sys/net/decnet/conf/eth<x>/forwarding echo "1" into /proc/sys/net/decnet/conf/eth<x>/priority (Must NOT be 0) --- 20,23 ---- Index: TODO =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TODO 4 May 2003 12:48:10 -0000 1.2 --- TODO 5 Apr 2006 07:17:44 -0000 1.3 *************** *** 1,5 **** - - Remove dead routes - - Add routes based on incoming routing messages - Check outgoing routing messages are still correct ! - Cope with the node having more than one address ! - Cope with the node being in more than one area (or an area router) \ No newline at end of file --- 1,2 ---- - Check outgoing routing messages are still correct ! - Cope with the node having more than one address (needs libdnet support!) Index: csum.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/csum.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** csum.c 19 Dec 2000 16:02:51 -0000 1.1 --- csum.c 5 Apr 2006 07:17:44 -0000 1.2 *************** *** 7,11 **** * 2 of the License, or (at your option) any later version. * ! * Authors: Patrick Caulfield <pa...@Ch...> * */ --- 7,11 ---- * 2 of the License, or (at your option) any later version. * ! * Authors: Patrick Caulfield <pa...@de...> * */ *************** *** 16,20 **** unsigned int sum = 1; /* Starting value for Phase IV */ int i; ! for (i=start; i<end; i++, i++) { --- 16,20 ---- unsigned int sum = 1; /* Starting value for Phase IV */ int i; ! for (i=start; i<end; i++, i++) { Index: dnroute.8 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/dnroute.8,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dnroute.8 14 Mar 2006 15:33:13 -0000 1.2 --- dnroute.8 5 Apr 2006 07:17:44 -0000 1.3 *************** *** 1,3 **** ! .TH DNROUTE 8 "May 4 2003" "DECnet utilities" .SH NAME --- 1,3 ---- ! .TH DNROUTE 8 "March 30 2006" "DECnet utilities" .SH NAME *************** *** 9,24 **** Options: .br ! [\-dvVhr] .SH DESCRIPTION .PP .B dnroute is a daemon that manages the DECnet routing tables to provide a simple ! routing policy. .br .B dnroute ! reads polls the DECnet neighbour table and copies those entries into ! the internal routing tables, thus providing a simple (I can see that node, ! therefore I can route to it) routing system. For many sites this will be ! simple enough. It is still possible to add routes using the ip(8) command. .SH OPTIONS --- 9,51 ---- Options: .br ! [\-dvV2Dtnhr] .SH DESCRIPTION .PP .B dnroute is a daemon that manages the DECnet routing tables to provide a simple ! but probably useful routing policy. .br .B dnroute ! listens for ! incoming routing messages and adds routes in the kernel ! for non-local areas that it ! sees. Routes will be modifed according to these messages so that the lowest ! cost route that is up will always be used. Routes to locally accessible ! nodes (it those in the neighbour table) will also be added. ! If you want to keep manual control ! of the route to a particular area, then add a line into dnroute.conf. eg: ! .br ! manual 26 ! .br ! will disable dnroute's setting of routing tables for that area. dnetinfo will ! still show the route that ! .B would ! have been set with (M) on the line to show it has been overidden. ! .br ! To implement its routing policies ! .B dnroute ! assumes that all interfaces on the system have a cost of 4. To change this ! add lines in /etc/dnroute.conf for each of the interfaces you ! need to change. eg ! .br ! eth0 6 ! .br ! eth1 8 ! .br ! tap0 10 ! .br ! A script called dnetinfo is provided that gets the routing information ! from dnroute and displays it on stdout in a format similar to the VMS command ! SHOW NET/OLD. .SH OPTIONS *************** *** 28,47 **** .TP .I "\-v" ! Verbose. The more of these there are the more verbose dnroute will be. .TP ! .I \-h \-? Displays help for using the command. .TP ! .I \-r ! Send DECnet routing messages showing the routes set by the daemon. .TP ! .I \-l ! Listen to incoming routing messages and add routes based on that information ! (not currently implemted) .TP ! .I \-V Show the version of dnroute. - .SH SEE ALSO .BR dnetd.conf "(5), " ip "(8)" --- 55,81 ---- .TP .I "\-v" ! Verbose. Log route changes to syslog. ! .TP ! .I "\-D" ! Debug log. Writes debugging information to stderr. Only useful with -d. .TP ! .I "\-h \-?" Displays help for using the command. .TP ! .I "\-r" ! Send DECnet routing messages showing the state of local nodes. .TP ! .I "\-2" ! Send DECnet level 2 (area) routing messages. Implies -r. .TP ! .I "\-t <secs>" ! Timer to send routing messages on. Defaults to 15 seconds. ! .TP ! .I "\-n" ! Do not set up routes, Just monitor the network. Useful for testing. ! .TP ! .I "\-V" Show the version of dnroute. .SH SEE ALSO .BR dnetd.conf "(5), " ip "(8)" Index: get_neigh.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/get_neigh.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** get_neigh.c 17 Mar 2006 14:44:30 -0000 1.6 --- get_neigh.c 5 Apr 2006 07:17:44 -0000 1.7 *************** *** 1,4 **** /* ! * get_neigh.c DECnet routing daemon (eventually...) * * This program is free software; you can redistribute it and/or --- 1,4 ---- /* ! * get_neigh.c DECnet routing daemon * * This program is free software; you can redistribute it and/or *************** [...1307 lines suppressed...] ! } ! ! /* Things that interrupt our sleep */ ! if (alarm_rang) ! { ! get_neighbours(); ! alarm_rang = 0; ! } ! ! if (show_network) ! { ! do_show_network(); ! show_network = 0; ! } ! } ! } ! unlink(STATUS_FIFO); ! exit(0); } Index: routing_msg.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/routing_msg.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** routing_msg.c 4 May 2003 11:53:31 -0000 1.2 --- routing_msg.c 5 Apr 2006 07:17:44 -0000 1.3 *************** *** 7,11 **** * 2 of the License, or (at your option) any later version. * ! * Authors: Patrick Caulfield <pa...@Ch...> * based on rtmon.c by Alexey Kuznetsov, <ku...@ms...> * --- 7,11 ---- * 2 of the License, or (at your option) any later version. * ! * Authors: Patrick Caulfield <pa...@de...> * based on rtmon.c by Alexey Kuznetsov, <ku...@ms...> * *************** *** 32,37 **** #include "csum.h" - int routing_multicast_timer = 15; - extern void send_route_msg(int); --- 32,35 ---- *************** *** 59,62 **** --- 57,76 ---- } + int if_name_to_index(char *name) + { + struct ifreq ifr; + static char buf[64]; + + int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + + ifr.ifr_ifindex = -1; + strcpy(ifr.ifr_name, name); + + ioctl(sock, SIOCGIFINDEX, &ifr); + + close(sock); + return ifr.ifr_ifindex; + } + static int dump_neigh_msg(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) Index: send_route.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/send_route.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** send_route.c 4 May 2003 12:48:10 -0000 1.5 --- send_route.c 5 Apr 2006 07:17:44 -0000 1.6 *************** *** 7,11 **** * 2 of the License, or (at your option) any later version. * ! * Authors: Patrick Caulfield <pa...@Ch...> * based on rtmon.c by Alexey Kuznetsov, <ku...@ms...> * --- 7,11 ---- * 2 of the License, or (at your option) any later version. * ! * Authors: Patrick Caulfield <pa...@de...> * based on rtmon.c by Alexey Kuznetsov, <ku...@ms...> * *************** *** 17,20 **** --- 17,21 ---- #include <syslog.h> #include <fcntl.h> + #include <assert.h> #include <sys/ioctl.h> #include <sys/socket.h> *************** *** 42,83 **** #include "dnrtlink.h" #include "csum.h" extern char *if_index_to_name(int ifindex); ! extern int routing_multicast_timer; ! /* Send a packet to all ethernet interfaces */ ! static int send_to_all(int dnet_socket, char *packet, int len, struct sockaddr_ll *sock_info) ! { ! struct ifreq ifr; ! int iindex = 1; ! ! int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); ! ! ifr.ifr_ifindex = iindex; ! ! while (ioctl(sock, SIOCGIFNAME, &ifr) == 0) ! { ! /* Only send to ethernet interfaces */ ! ioctl(sock, SIOCGIFHWADDR, &ifr); ! if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) ! { ! sock_info->sll_ifindex = iindex; ! if (sendto(dnet_socket, packet, len, 0, ! (struct sockaddr *)sock_info, sizeof(*sock_info)) < 0) ! perror("sendto"); ! } ! ifr.ifr_ifindex = ++iindex; ! } ! ! close(sock); ! return 0; ! } ! ! ! /* Send a routine message for nodes "start" to "end". ! "start" should be a multiple of 32 for the header to be ! added correctly */ ! static int send_routing_message(char *node_table, int start, int end, ! int dnet_socket, struct dn_naddr *exec) { struct sockaddr_ll sock_info; --- 43,57 ---- #include "dnrtlink.h" #include "csum.h" + #include "dnroute.h" extern char *if_index_to_name(int ifindex); ! extern int dnet_socket; ! /* Send a Level 1 routing message for nodes "start" to "end". ! * "start" should be a multiple of 32 for the header to be ! * added correctly/ ! */ ! static int send_routing_message(unsigned char type, struct routeinfo *node_table, int start, int end, ! struct dn_naddr *exec, int interface) { struct sockaddr_ll sock_info; *************** *** 86,89 **** --- 60,67 ---- int i,j; + assert (!((start-end) & 0x3F)); + + fprintf(stderr,"Sending message type %d. start=%d, end=%d\n", type,start,end); + i=0; *************** *** 91,95 **** packet[i++] = 0x05; ! packet[i++] = 0x07; /* Level 1 routing message */ packet[i++] = exec->a_addr[0]; /* Our node address */ packet[i++] = exec->a_addr[1]; --- 69,73 ---- packet[i++] = 0x05; ! packet[i++] = type; packet[i++] = exec->a_addr[0]; /* Our node address */ packet[i++] = exec->a_addr[1]; *************** *** 106,129 **** packet[i++] = j>>8; } ! switch (node_table[j]) { - case 0: /* Unreachable */ - default: packet[i++] = 0xff; packet[i++] = 0x7f; - break; - case 1: /* Reachable, cost 4, hops 2 */ - packet[i++] = 0x04; - packet[i++] = 0x04; - break; - case 2: /* Local, cost 0, hops 0 */ - packet[i++] = 0x0; - packet[i++] = 0x0; - break; } } /* Add in checksum */ ! sum = route_csum(packet, 4, i); packet[i++] = sum & 0xFF; packet[i++] = sum >> 8; --- 84,101 ---- packet[i++] = j>>8; } ! if (node_table[j].valid) ! { ! packet[i++] = node_table[j].cost; /* cost can use the low bit of the next byte... */ ! packet[i++] = (node_table[j].hops << 1) | ((node_table[j].cost>>8) & 1); /* hops - starting bit 1 */ ! } ! else { packet[i++] = 0xff; packet[i++] = 0x7f; } } /* Add in checksum */ ! sum = route_csum(packet, 6, i); packet[i++] = sum & 0xFF; packet[i++] = sum >> 8; *************** *** 132,141 **** sock_info.sll_family = AF_PACKET; sock_info.sll_protocol = htons(ETH_P_DNA_RT); ! sock_info.sll_ifindex = 2; /* TODO: DO ALL INTERFACES... */ sock_info.sll_hatype = 0; sock_info.sll_pkttype = PACKET_MULTICAST; sock_info.sll_halen = 6; ! /* This is the DECnet multicast address */ sock_info.sll_addr[0] = 0xab; sock_info.sll_addr[1] = 0x00; --- 104,113 ---- sock_info.sll_family = AF_PACKET; sock_info.sll_protocol = htons(ETH_P_DNA_RT); ! sock_info.sll_ifindex = interface; sock_info.sll_hatype = 0; sock_info.sll_pkttype = PACKET_MULTICAST; sock_info.sll_halen = 6; ! /* This is the DECnet routing multicast address */ sock_info.sll_addr[0] = 0xab; sock_info.sll_addr[1] = 0x00; *************** *** 145,167 **** sock_info.sll_addr[5] = 0x00; ! /* Send to all interfaces */ ! return send_to_all(dnet_socket, packet, i, &sock_info); } ! void send_route_msg(char *node_table) { ! int dnet_socket; ! struct rtnl_handle rth; struct dn_naddr *addr; /* Get our node address */ addr = getnodeadd(); - dnet_socket = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_DNA_RT)); ! /* 576 is a multiple of 32 so the mask in ! send_routine_message() works */ ! send_routing_message(node_table, 0, 575, dnet_socket, addr); ! send_routing_message(node_table, 576, 1023, dnet_socket, addr); ! close(dnet_socket); } --- 117,192 ---- sock_info.sll_addr[5] = 0x00; ! if (sendto(dnet_socket, packet, i, 0, ! (struct sockaddr *)&sock_info, sizeof(sock_info)) < 0) ! { ! perror("sendto"); ! return -1; ! } ! return 0; } ! static void send_route_msg(unsigned char type, struct routeinfo *node_table, int num) { ! struct ifreq ifr; ! int iindex = 1; struct dn_naddr *addr; + int last_node; + int sock; + + sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + if (sock < 0) + return; /* Get our node address */ addr = getnodeadd(); ! for (iindex = 0; iindex < 128; iindex++) ! { ! ifr.ifr_ifindex = iindex; ! if (ioctl(sock, SIOCGIFNAME, &ifr) == 0) ! { ! /* Only send to ethernet interfaces */ ! ioctl(sock, SIOCGIFHWADDR, &ifr); ! if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) ! { ! int mtu; ! int num_nodes; ! ! last_node = 0; ! ! ioctl(sock, SIOCGIFMTU, &ifr); ! mtu = ifr.ifr_mtu; ! ! /* Work out how many blocks we get into one MTU-sized packet */ ! /* header = 32 bytes, 2 bytes per node, in multiples of 32 nodes */ ! num_nodes = (mtu-32)/2 & 0xFFC0; ! if (num_nodes > 256) num_nodes = 256; /* cap it */ ! ! while (last_node < num) ! { ! /* Don't overflow the end of the list */ ! if (last_node+num_nodes > num) ! num_nodes = num-last_node; ! ! send_routing_message(type, node_table, last_node, last_node+num_nodes, addr, iindex); ! last_node += num_nodes; ! } ! } ! ifr.ifr_ifindex = iindex; ! } ! } ! ! close(sock); ! return; ! } ! ! void send_level1_msg(struct routeinfo *node_table) ! { ! send_route_msg(0x07, node_table, 1024); ! } ! ! void send_level2_msg(struct routeinfo *area_table) ! { ! send_route_msg(0x09, area_table, 64); } |
|
From: Patrick C. <pa...@us...> - 2006-03-30 07:56:20
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2440/multinet Modified Files: Makefile Added Files: multinet.8 Log Message: Include multinet in packages, and add man page --- NEW FILE: multinet.8 --- .TH MULTINET 8 "March 30 2006" "DECnet utilities" .SH NAME multinet \- Connect to a Multinet* DECnet over IP server .SH SYNOPSIS .B multinet [options] <local-decnet-addr> <remote-host> .br .SH DESCRIPTION .PP This utility creates a tapX device and copies all the DECnet packets from that over IP to a remte Multinet* server. It provides a way to connect a Linux box to a remote VMS machine over an IP-only network. Using Linux routing it should be possible to connect DECnet networks over the internet using this technique. .br .B local-decnet-addr DECnet node address of the tapX interface. This need not be the same as the address used on other interfaces but it might be less confusing if it is. .br .B remote-host IP address or host name of the remote Multinet server. .br .br .br .TP *Multinet is a product, and probably a trademark, of Process Software. http://www.process.com and is available free for hobbyist use. .br The protcol used here was reverse engineered by Mark Berryman and Patrick Caulfield. .SH OPTIONS .TP .I "\-v" Be verbose and dump packet contents to stderr .TP .I "\-1" Advertise as a level 1 router .TP .I "\-2" Advertise as a level 2 router (default) .TP .I "\-D" Make the tapX device into the default DECnet device. This will force all traffic to non-local nodes down the Multinet link. IMPORTANT: Due to a kernel bug you should not use this option unless you are using a Linux kernel version 2.6.17 or later. .TP .I "\-p priority" Router priority. Default is 64 .TP .I "\-P port" Port to talk to Multinet on (default is 700). Ony change this if you know the Multinet server is listening on a different port .TP .I "\-m MTU" Maximum size of packets. (default 576) .TP .I "-t secs" Timeout for IP connections. If no traffic is seen on the IP connection after this time then the daemon will attempt to restart it. .TP .I "-H hello timer" How often HELLO messages are sent (default 60) in seconds. .SH EXAMPLES .br multinet -1 -D 3.2 zarqon.tykepenguin.com .SH SEE ALSO .BR dnroute "(8), " ip "(8)" Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/multinet/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Makefile 28 Mar 2006 11:00:22 -0000 1.1 --- Makefile 30 Mar 2006 07:56:11 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- + include ../Makefile.common + CFLAGS=-Wall -g *************** *** 5,6 **** --- 7,21 ---- multinet: multinet.c $(CC) $(CFLAGS) $(LDFLAGS) -o multinet multinet.c + + + install: + install -d $(prefix)/sbin + install -d $(manprefix)/man/man8 + install -m 0755 -s multinet $(prefix)/sbin + install -m 0644 multinet.8 $(manprefix)/man/man8 + + dep depend: + $(CC) $(CFLAGS) -MM *.c >.depend 2>/dev/null + + clean: + rm -f *.o *~ multinet |
|
From: Patrick C. <pa...@us...> - 2006-03-30 07:56:16
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2440/debian Modified Files: dnet-progs.files Log Message: Include multinet in packages, and add man page Index: dnet-progs.files =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.files,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dnet-progs.files 21 Oct 2005 14:43:25 -0000 1.4 --- dnet-progs.files 30 Mar 2006 07:56:11 -0000 1.5 *************** *** 7,10 **** --- 7,11 ---- ./usr/sbin/dnetd ./usr/sbin/dnroute + ./usr/sbin/multinet ./usr/bin/dndir ./usr/bin/dnsubmit *************** *** 30,33 **** --- 31,35 ---- ./usr/share/man/man8/vmsmaild.8 ./usr/share/man/man8/dnroute.8 + ./usr/share/man/man8/multinet.8 ./usr/share/man/man5/vmsmail.conf.5 ./usr/share/man/man1/dndel.1 |
|
From: Patrick C. <pa...@us...> - 2006-03-30 07:56:13
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2440 Modified Files: rpm.spec Log Message: Include multinet in packages, and add man page Index: rpm.spec =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/rpm.spec,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** rpm.spec 27 Oct 2005 12:31:26 -0000 1.10 --- rpm.spec 30 Mar 2006 07:56:11 -0000 1.11 *************** *** 40,43 **** --- 40,44 ---- %%PREFIX%%/sbin/sendvmsmail %%PREFIX%%/sbin/vmsmaild + %%PREFIX%%/sbin/multinet %%PREFIX%%/man/man1/dncopy.1 %%PREFIX%%/man/man1/phone.1 *************** *** 82,85 **** --- 83,87 ---- %%PREFIX%%/man/man8/setether.8 %%PREFIX%%/man/man8/decnetconf.8 + %%PREFIX%%/man/man8/multinet.8 /etc/rc.d/init.d/decnet /etc/decnet.proxy |
|
From: Patrick C. <pa...@us...> - 2006-03-30 07:54:32
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1684 Modified Files: setether.sh Log Message: Add usage message Index: setether.sh =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/setether.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** setether.sh 26 Mar 2002 11:02:07 -0000 1.5 --- setether.sh 30 Mar 2006 07:54:28 -0000 1.6 *************** *** 7,11 **** # # $1 - DECnet address in the usual area.node format ! # $2 - optional list of ethernet card names to set. # --- 7,11 ---- # # $1 - DECnet address in the usual area.node format ! # $2 - List of ethernet card names to set or "all" # *************** *** 36,51 **** } ! calc_ether $1 ! if [ $? != 0 ] then exit 1 fi ! CARDS=$2 ! if [ -z "$CARDS" ] then ! exit 0 fi if [ "$CARDS" = "all" -o "$CARDS" = "ALL" ] then --- 36,57 ---- } ! if [ -z "$2" ] then + echo "" + echo "usage: $0 <decnet-addr> <network interfaces>|all" + echo "" + echo " eg. $0 1.9 eth0 " + echo " eg. $0 1.9 all" + echo "" exit 1 fi ! calc_ether $1 ! if [ $? != 0 ] then ! exit 1 fi + CARDS=$2 if [ "$CARDS" = "all" -o "$CARDS" = "ALL" ] then |
|
From: Patrick C. <pa...@us...> - 2006-03-29 16:25:14
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11390 Modified Files: multinet.c Log Message: More tweaks. more options. Index: multinet.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/multinet/multinet.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** multinet.c 29 Mar 2006 12:11:23 -0000 1.5 --- multinet.c 29 Mar 2006 16:25:02 -0000 1.6 *************** *** 27,30 **** --- 27,31 ---- #include <stdlib.h> #include <unistd.h> + #include <time.h> #include <sys/types.h> #include <sys/poll.h> *************** *** 56,63 **** static int mtu = 578; static int port = 700; ! #define DUMP_MAX 1024 static int send_ip(int fudge_header, unsigned char *, int len); --- 57,75 ---- static int mtu = 578; static int port = 700; ! static int ip_timeout = 300; ! static int hello_timer = 60; ! static char old_default[1024]; ! static time_t last_ip_packet; ! static sig_atomic_t running; #define DUMP_MAX 1024 + static void do_shutdown(int sig) + { + if (verbose) + fprintf(stderr, "Got signal, shutting down\n"); + running = 0; + } + static int send_ip(int fudge_header, unsigned char *, int len); *************** *** 146,152 **** header[15] = (len+16) >> 8; ! /* Fake DECnet header */ header[18] = header[19] = 0; ! header[16] = 0x81; header[17] = 0x26; // Don't know what this is! header[20] = header[28] = 0xAA; --- 158,164 ---- header[15] = (len+16) >> 8; ! /* Fake Long DECnet header */ header[18] = header[19] = 0; ! header[16] = 0x81; header[17] = 0x26; // TODO Don't know what this is! header[20] = header[28] = 0xAA; *************** *** 191,195 **** { /* Shorten DECnet addresses */ ! buf[0] = 0x02; // TODO what is this ?? buf[1] = buf[8]; /* Destination */ buf[2] = buf[9]; --- 203,207 ---- { /* Shorten DECnet addresses */ ! buf[0] = 0x02; /* Short data message */ buf[1] = buf[8]; /* Destination */ buf[2] = buf[9]; *************** *** 263,266 **** --- 275,280 ---- if (len <= 0) return; + last_ip_packet = time(NULL); + dump_data("from IP:", buf, len); *************** *** 276,280 **** router_priority, /* Priority */ 0x00, /* Reserved */ ! 0x0f, 0x00, /* Hello timer (seconds) */ // TODO 0x00, /* Reserved */ 0x00, /* Length of (other 'logical' ethernets) message that follows */ --- 290,295 ---- router_priority, /* Priority */ 0x00, /* Reserved */ ! hello_timer&0xFF, ! hello_timer >> 8, /* Hello timer (seconds) */ 0x00, /* Reserved */ 0x00, /* Length of (other 'logical' ethernets) message that follows */ *************** *** 288,293 **** } ! /* Trap INIT & VERF messages, they're for us */ ! if (buf[4] == 0x01 || buf[4] == 0x05) { if (!got_remote_addr) --- 303,308 ---- } ! /* Trap INIT & VERF & test messages, they're for us */ ! if (buf[4] == 0x01 || buf[4] == 0x05 || buf[4] == 0x03) { if (!got_remote_addr) *************** *** 302,313 **** return; } - if (buf[4] == 0x03) // TODO check this - { - if (verbose) - fprintf(stderr, "Discarding 0x03 message\n"); - return; - } ! if (buf[4] == 0x07 || buf[4] == 0x09) /* Routing info */ // TODO Fix this ! { /* --- 317,322 ---- return; } ! if (buf[4] == 0x07 || buf[4] == 0x09) /* Routing info */ // TODO check this { /* *************** *** 325,329 **** off Multinet: ! 09 00 00 00 multinet header 09 23 0c 00 3f 00 01 00 04 04 0a 04 00 00 ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 04 04 --- 334,338 ---- off Multinet: ! 09 00 00 00 multinet header 09 23 0c 00 3f 00 01 00 04 04 0a 04 00 00 ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 04 04 *************** *** 353,356 **** --- 362,374 ---- if (len <= 0) return; + /* We get local HELLOs from time to time so this shoud ensure that we're not + flooding the IP link with dodgy UDP continously + */ + if (time(NULL) - last_ip_packet > ip_timeout) + { + got_verification = 0; + resend_start(SIGALRM); + } + /* Only forward DECnet packets... */ if (buf[12] == 0x60 && buf[13] == 0x03) *************** *** 389,393 **** } ! static int setup_tun(unsigned short addr) { int ret; --- 407,411 ---- } ! static int setup_tun(unsigned short addr, int make_default) { int ret; *************** *** 413,420 **** --- 431,446 ---- fprintf(stderr, "using tun device %s\n", ifr.ifr_name); + /* Bring the interface up + * TODO: use ioctls...perhaps + */ sprintf(cmd, "/sbin/ifconfig %s hw ether AA:00:04:00:%02X:%02X allmulti mtu %d up\n", ifr.ifr_name, addr & 0xFF, addr>>8, mtu); system(cmd); + + /* Configure the interface. + * Sigh, this maybe should be sone using sysctl but that interface + * is probably worse than poking values into /proc ! + */ sprintf(cmd, "/proc/sys/net/decnet/conf/%s/forwarding", ifr.ifr_name); procfile = fopen(cmd, "w"); *************** *** 441,459 **** } return tunfd; } static void usage(char *cmd) { ! printf("Usage: %s [-v12?h] [-p<prio>] [-P<port>] [-m<MTU>] <decnet-addr> <remote-host>\n", cmd); ! printf("eg %s zarqon 3.2\n", cmd); printf(" -v Verbose output\n"); printf(" -1 Advertise as a level 1 router\n"); printf(" -2 Advertise as a level 2 router (default)\n"); printf(" -p<prio> Router priority (default 64)\n"); printf(" -P<port> IP port to talk to multinet on (default 700)\n"); ! printf(" -m<MTU> MTU of interface (default 578)\n"); } --- 467,534 ---- } + sprintf(cmd, "/proc/sys/net/decnet/conf/%s/t3", ifr.ifr_name); + procfile = fopen(cmd, "w"); + if (!procfile) + { + fprintf(stderr, "Cannot set hello timer\n"); + } + else + { + fprintf(procfile, "%d", hello_timer); + fclose(procfile); + } + + if (make_default) + { + procfile = fopen("/proc/sys/net/decnet/default_device", "w+"); + if (!procfile) + { + fprintf(stderr, "Cannot set default device\n"); + } + else + { + fgets(old_default, sizeof(old_default), procfile); + fprintf(procfile, "%s", ifr.ifr_name); + fclose(procfile); + } + } + return tunfd; } + static void restore_interface(void) + { + if (old_default[0]) + { + FILE *procfile; + + procfile = fopen("/proc/sys/net/decnet/default_device", "w+"); + if (!procfile) + { + fprintf(stderr, "Cannot restore default device\n"); + } + else + { + fprintf(procfile, "%s", old_default); + fclose(procfile); + } + } + } + static void usage(char *cmd) { ! printf("Usage: %s [options] <local-decnet-addr> <remote-host>\n", cmd); ! printf("eg %s -D 3.2 zarqon\n\n", cmd); printf(" -v Verbose output\n"); printf(" -1 Advertise as a level 1 router\n"); printf(" -2 Advertise as a level 2 router (default)\n"); + printf(" -D Make this the default DECnet interface (default no)\n"); printf(" -p<prio> Router priority (default 64)\n"); printf(" -P<port> IP port to talk to multinet on (default 700)\n"); ! printf(" -m<MTU> MTU of interface (default 576)\n"); ! printf(" -t<secs> Timeout to restart IP connections (default 600)\n"); ! printf(" -H<secs> Hello timer (default 60)\n"); } *************** *** 464,467 **** --- 539,543 ---- unsigned int area, node; unsigned short addr; + int make_default = 0; struct addrinfo *ainfo; struct addrinfo ahints; *************** *** 469,473 **** int opt; ! while ((opt=getopt(argc,argv,"vp:12m:P:?h")) != EOF) { switch(opt) --- 545,549 ---- int opt; ! while ((opt=getopt(argc,argv,"vp:12m:P:t:H:D?h")) != EOF) { switch(opt) *************** *** 496,499 **** --- 572,587 ---- break; + case 'D': + make_default = 1; + break; + + case 'H': + hello_timer = atoi(optarg); + break; + + case 't': + ip_timeout = atoi(optarg); + break; + case 'm': mtu = atoi(optarg); *************** *** 553,558 **** remote_addr.sin_port = htons(port); ! /* initialise network ports */ ! tunfd = setup_tun(addr); ipfd = setup_ip(port); --- 641,649 ---- remote_addr.sin_port = htons(port); ! signal(SIGINT, do_shutdown); ! signal(SIGTERM, do_shutdown); ! ! /* Initialise network ports */ ! tunfd = setup_tun(addr, make_default); ipfd = setup_ip(port); *************** *** 571,575 **** fcntl(tunfd, F_SETFL, fcntl(tunfd, F_GETFL, 0) | O_NONBLOCK); ! while (1) { int status; --- 662,667 ---- fcntl(tunfd, F_SETFL, fcntl(tunfd, F_GETFL, 0) | O_NONBLOCK); ! running = 1; ! while (running) { int status; *************** *** 587,590 **** --- 679,685 ---- } + if (make_default) + restore_interface(); + return 0; } |
|
From: Patrick C. <pa...@us...> - 2006-03-29 12:11:28
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13789 Modified Files: multinet.c Log Message: More tinkering Index: multinet.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/multinet/multinet.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** multinet.c 29 Mar 2006 10:20:57 -0000 1.4 --- multinet.c 29 Mar 2006 12:11:23 -0000 1.5 *************** *** 60,64 **** #define DUMP_MAX 1024 ! static int send_ip(int use_seq, unsigned char *, int len); static void dump_data(char *from, unsigned char *databuf, int datalen) --- 60,64 ---- #define DUMP_MAX 1024 ! static int send_ip(int fudge_header, unsigned char *, int len); static void dump_data(char *from, unsigned char *databuf, int datalen) *************** *** 169,173 **** dump_data("to TUN0:", header, header_len); ! dump_data("to TUN1:", buf+6, len-6); writev(tunfd, iov, 2); --- 169,173 ---- dump_data("to TUN0:", header, header_len); ! dump_data("to TUN1:", buf, len); writev(tunfd, iov, 2); *************** *** 267,283 **** if (buf[4] == 0x05) /* PtP hello */ { ! // TODO get router priority & level from /proc */ ! unsigned char hello[] = {/* Router 2 hello message */ ! 0x00, 0x00, /* Length, filled in later */ ! 0x0b, /* FLAGS: Router hello */ ! 0x02, 0x00, 0x00, /* Router version */ 0xaa, 0x00, 0x04, 0x00, buf[5], buf[6], /* Routers MAC addr */ ! router_level, /* Info, including routing level */ mtu % 0xFF, mtu >> 8, /* Data block size */ ! 0x40, /* Priority */ ! 0x00, /* Reserved */ ! 0x0f, 0x00, /* Hello timer (seconds) */ ! 0x00, /* Reserved */ ! 0x00, /* Length of (other 'logical' ethernets) message that follows */ }; --- 267,282 ---- if (buf[4] == 0x05) /* PtP hello */ { ! unsigned char hello[] = { ! 0x00, 0x00, /* Length, filled in later */ ! 0x0b, /* FLAGS: Router hello */ ! 0x02, 0x00, 0x00, /* Router version */ 0xaa, 0x00, 0x04, 0x00, buf[5], buf[6], /* Routers MAC addr */ ! router_level, /* Info, including routing level */ mtu % 0xFF, mtu >> 8, /* Data block size */ ! router_priority, /* Priority */ ! 0x00, /* Reserved */ ! 0x0f, 0x00, /* Hello timer (seconds) */ // TODO ! 0x00, /* Reserved */ ! 0x00, /* Length of (other 'logical' ethernets) message that follows */ }; *************** *** 286,290 **** got_verification = 1; ! alarm(0); } --- 285,289 ---- got_verification = 1; ! alarm(0); /* cancel START timer */ } *************** *** 310,314 **** } ! if (buf[4] == 0x07) /* Routing info */ // TODO Fix this ! { /* --- 309,313 ---- } ! if (buf[4] == 0x07 || buf[4] == 0x09) /* Routing info */ // TODO Fix this ! { /* *************** *** 326,331 **** off Multinet: ! 09 00 00 00 09 23 ! 0c 00 3f 00 01 00 04 04 0a 04 00 00 ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 04 04 ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f --- 325,330 ---- off Multinet: ! 09 00 00 00 multinet header ! 09 23 0c 00 3f 00 01 00 04 04 0a 04 00 00 ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 04 04 ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f *************** *** 378,381 **** --- 377,386 ---- return ; } + /* Routing messages, Don't fudge the header on these */ + if (buf[16] == 0x07 || buf[16] == 0x09) + { + send_ip(0, buf+16, len-16); + return; + } /* Data or other packet */ *************** *** 436,440 **** } - return tunfd; } --- 441,444 ---- |