linux-decnet-commit Mailing List for DECnet for Linux (Page 9)
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: Christine C. <chr...@us...> - 2008-09-17 08:00:20
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4421 Modified Files: nml.c Log Message: Add show known objects Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** nml.c 17 Sep 2008 14:18:01 -0000 1.9 --- nml.c 17 Sep 2008 15:00:17 -0000 1.10 *************** *** 21,24 **** --- 21,25 ---- #include <syslog.h> #include <errno.h> + #include <limits.h> #include <ctype.h> #include <unistd.h> *************** *** 67,70 **** --- 68,90 ---- } link_nodes[MAX_ADJACENT_NODES]; + // Object definition from dnetd.conf + #define USERNAME_LENGTH 65 + #ifndef TRUE + #define TRUE 1 + #define FALSE 0 + #endif + + struct object + { + char name[USERNAME_LENGTH]; // Object name + unsigned int number; // Object number + int proxy; // Whether to use proxies + char user[USERNAME_LENGTH]; // User to use if proxies not used + char daemon[PATH_MAX]; // Name of daemon + + struct object *next; + }; + static struct object *object_db = NULL; + static void makeupper(char *s) { *************** *** 321,326 **** memset(tb, 0, sizeof(tb)); ! parse_rtattr(tb, NDA_MAX, NDA_RTA(r), n->nlmsg_len - NLMSG_LENGTH(sizeof ! (*r))); if (tb[NDA_DST]) --- 341,345 ---- memset(tb, 0, sizeof(tb)); ! parse_rtattr(tb, NDA_MAX, NDA_RTA(r), n->nlmsg_len - NLMSG_LENGTH(sizeof(*r))); if (tb[NDA_DST]) *************** *** 489,492 **** --- 508,677 ---- } + /* Copied from libdnet_daemon ... bad girl */ + static int load_dnetd_conf(void) + { + FILE *f; + char buf[4096]; + int line; + struct object *last_object = NULL; + + f = fopen("/etc/dnetd.conf", "r"); + if (!f) + { + DNETLOG((LOG_ERR, "Can't open dnetd.conf database: %s\n", + strerror(errno))); + return -1; + } + + line = 0; + + while (!feof(f)) + { + char tmpbuf[1024]; + char *bufp; + char *comment; + struct object *newobj; + int state = 1; + + line++; + if (!fgets(buf, sizeof(buf), f)) break; + + // Skip whitespace + bufp = buf; + while (*bufp == ' ' || *bufp == '\t') bufp++; + + if (*bufp == '#') continue; // Comment + + // Remove trailing LF + if (buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; + + // Remove any trailing comments + comment = strchr(bufp, '#'); + if (comment) *comment = '\0'; + + if (*bufp == '\0') continue; // Empty line + + // Split into fields + newobj = malloc(sizeof(struct object)); + state = 1; + bufp = strtok(bufp, " \t"); + while(bufp) + { + char *nextspace = bufp+strlen(bufp); + if (*nextspace == ' ' || *nextspace == '\t') *nextspace = '\0'; + switch (state) + { + case 1: + strcpy(newobj->name, bufp); + break; + case 2: + strcpy(tmpbuf, bufp); + newobj->number = atoi(tmpbuf); + break; + case 3: + strcpy(tmpbuf, bufp); + newobj->proxy = (toupper(tmpbuf[0])=='Y'?TRUE:FALSE); + break; + case 4: + strcpy(newobj->user, bufp); + break; + case 5: + strcpy(newobj->daemon, bufp); + break; + default: + // Copy parameters + strcat(newobj->daemon, " "); + strcat(newobj->daemon, bufp); + break; + } + bufp = strtok(NULL, " \t"); + state++; + } + + // Did we get all the info ? + if (state > 5) + { + // Add to the list + if (last_object) + { + last_object->next = newobj; + } + else + { + object_db = newobj; + } + last_object = newobj; + } + else + { + DNETLOG((LOG_ERR, "Error in dnet.conf line %d, state = %d\n", line, state)); + free(newobj); + } + } + return 0; + } + + static int send_objects(int sock) + { + struct object *obj; + char buf[256]; + char response; + int ptr; + + if (load_dnetd_conf()) { + buf[0] = -3; // Privilege violation + write(sock, &response, 1); + return -1; + } + + response = 2; + write(sock, &response, 1); + + obj = object_db; + while (obj) { + dnetlog(LOG_DEBUG, "object %s (%d)\n", obj->name, obj->number); + + ptr = 0; + buf[ptr++] = 1; + + buf[ptr++] = 0xff; // Object Name + buf[ptr++] = 0xff; + buf[ptr++] = 0x0; + buf[ptr++] = strlen(obj->name); + strcpy(&buf[ptr], obj->name); + ptr+=strlen(obj->name); + + buf[ptr++] = 0x01; + buf[ptr++] = 0x02; + buf[ptr++] = 0x01; + buf[ptr++] = obj->number; + + if (obj->daemon) { + buf[ptr++] = 0x12; + buf[ptr++] = 0x02; + buf[ptr++] = 0x40; + buf[ptr++] = strlen(obj->daemon); + strcpy(&buf[ptr], obj->daemon); + ptr+=strlen(obj->daemon); + } + + if (!obj->proxy) { + buf[ptr++] = 0x26; + buf[ptr++] = 0x02; + buf[ptr++] = 0x40; + buf[ptr++] = strlen(obj->user); + strcpy(&buf[ptr], obj->user); + ptr+=strlen(obj->user); + } + write(sock, buf, ptr); + + obj = obj->next; + } + + response = -128; + write(sock, &response, 1); + return 0; + } + static int send_links(int sock) *************** *** 659,666 **** buf[1] = 0; buf[2] = 0; ! // TODO This text should be of the defined type... ! strcpy(&buf[3], "Unrecognised command"); ! ! write(sock, buf, strlen(&buf[3])+3); } --- 844,848 ---- buf[1] = 0; buf[2] = 0; ! write(sock, buf, 3); } *************** *** 711,715 **** break; case 22:// System-specific function ! send_links(sock); break; default: --- 893,906 ---- break; case 22:// System-specific function ! switch (buf[3]) { ! case 7: ! send_links(sock); ! break; ! case 4: ! send_objects(sock); ! break; ! default: ! unsupported(sock); ! } break; default: *************** *** 719,723 **** } while (status > 0); ! return 0; } --- 910,914 ---- } while (status > 0); ! close(sock); return 0; } |
From: Christine C. <chr...@us...> - 2008-09-17 07:18:06
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15732 Modified Files: nml.c Log Message: Fix link count in "show <x> node" Add "SHOW KNOWN LINKS" Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** nml.c 17 Sep 2008 10:53:00 -0000 1.8 --- nml.c 17 Sep 2008 14:18:01 -0000 1.9 *************** *** 73,76 **** --- 73,97 ---- } + /* Convert an object number to text */ + char * object_name(char *number) { + int objnum = atoi(number); + + switch(objnum) { + case 17: return "FAL"; + case 18: return "HLD"; + case 19: return "NML"; + case 23: return "REMACP"; + case 25: return "MIRROR"; + case 26: return "EVL"; + case 27: return "MAIL"; + case 29: return "PHONE"; + case 42: return "CTERM"; + case 51: return "VPM"; + case 63: return "DTR"; + default: + return number; + } + } + static int adjacent_node(struct nodeent *n) { *************** *** 130,134 **** while (!feof(procfile)) { ! fgets(buf, sizeof(buf), procfile); if (sscanf(buf, "%s %s %s %s %s %s %s %s %s ethernet %s\n", var1,var2,var3,var4,var5,var6,var7,var8,var9,var11) == 10) --- 151,156 ---- while (!feof(procfile)) { ! if (!fgets(buf, sizeof(buf), procfile)) ! break; if (sscanf(buf, "%s %s %s %s %s %s %s %s %s ethernet %s\n", var1,var2,var3,var4,var5,var6,var7,var8,var9,var11) == 10) *************** *** 430,434 **** while (!feof(procfile)) { ! fgets(buf, sizeof(buf), procfile); if (sscanf(buf, "%s %s %s %s %s %s %s %s %s %s %s\n", var1,var2,var3,var4,var5,var6,var7,var8, var9, var10, var11) == 11) { --- 452,457 ---- while (!feof(procfile)) { ! if (!fgets(buf, sizeof(buf), procfile)) ! break; if (sscanf(buf, "%s %s %s %s %s %s %s %s %s %s %s\n", var1,var2,var3,var4,var5,var6,var7,var8, var9, var10, var11) == 11) { *************** *** 464,468 **** --- 487,608 ---- fclose(procfile); return 0; + } + + + static int send_links(int sock) + { + char inbuf[256]; + char buf[256]; + char var1[32]; + char var2[32]; + char var3[32]; + char var4[32]; + char luser[32]; + char var6[32]; + char var7[32]; + char var8[32]; + char var9[32]; + char ruser[32]; + char state[32]; + int i; + char response; + int ptr = 0; + FILE *procfile = fopen("/proc/net/decnet", "r"); + + if (!procfile) + return 0; + + response = 2; + // Tell remote end we are sending the data. + write(sock, &response, 1); + + while (!feof(procfile)) + { + if (!fgets(inbuf, sizeof(inbuf), procfile)) + break; + if (sscanf(inbuf, "%s %s %s %s %s %s %s %s %s %s %s\n", + var1,var2,var3,var4,luser,var6,var7,var8, var9, ruser, state) == 11) { + int area, node; + int llink, rlink; + unsigned char scratch_na[2]; + struct nodeent *nent; + + /* In case we ever do "SHOW KNOWN LINKS: + * var10 is remote user, var5 is local user + */ + sscanf(var1, "%d.%d/%x\n", &area, &node, &llink); + sscanf(var6, "%d.%d/%x\n", &area, &node, &rlink); + + /* Ignore 0.0 links (listeners) and anything not in RUN state */ + if (area == 0 || node == 0 || strcmp(state, "RUN")) + continue; + + dnetlog(LOG_DEBUG, "node %d.%d links %d & %d state=%s\n", area,node, llink,rlink, state); + + /* Get remote node name */ + scratch_na[1] = area<<2 | node>>8; + scratch_na[0] = node & 0xFF; + nent = getnodebyaddr((char *)scratch_na, 2, AF_DECnet); + + /* we don't really show users as such for remote connectionsm, + sho make the object numbers look friendlier */ + if (atoi(luser)) + strcpy(luser, object_name(luser)); + if (atoi(ruser)) + strcpy(ruser, object_name(ruser)); + + ptr = 0; + buf[ptr++] = 1; // Here is your data miss + + buf[ptr++] = 0xff; + buf[ptr++] = 0xff; // Local link (seems to be compulsory! + buf[ptr++] = 0; + buf[ptr++] = 0; + buf[ptr++] = rlink & 0xFF; + buf[ptr++] = rlink>>8; + + buf[ptr++] = 120; // Remote link + buf[ptr++] = 0; + buf[ptr++] = 2; + buf[ptr++] = llink & 0xFF; + buf[ptr++] = llink>>8; + + buf[ptr++] = 0x79; // Remote user + buf[ptr++] = 0; + buf[ptr++] = 0x40; + buf[ptr++] = strlen(ruser); + memcpy(&buf[ptr], ruser, strlen(ruser)); + ptr += strlen(ruser); + + buf[ptr++] = 131; // Local process + buf[ptr++] = 0; + buf[ptr++] = 0x40; + buf[ptr++] = strlen(luser); + memcpy(&buf[ptr], luser, strlen(luser)); + ptr += strlen(luser); + + if (nent) { + buf[ptr++] = 0x66; // 0x66 Remote node (addr+name) + buf[ptr++] = 0x00; + buf[ptr++] = 0xc2; // Still don't know what this is + buf[ptr++] = 0x02; + buf[ptr++] = scratch_na[0]; + buf[ptr++] = scratch_na[1]; + buf[ptr++] = 0x40; // Text data + buf[ptr++] = strlen(nent->n_name); + makeupper(nent->n_name); + memcpy(&buf[ptr], nent->n_name, strlen(nent->n_name)); + ptr += strlen(nent->n_name); + } + write(sock, buf, ptr); + } + } + fclose(procfile); + + // End of data. + response = -128; + write(sock, &response, 1); + return 0; } *************** *** 571,575 **** break; case 22:// System-specific function ! unsupported(sock); break; default: --- 711,715 ---- break; case 22:// System-specific function ! send_links(sock); break; default: |
From: Christine C. <chr...@us...> - 2008-09-17 04:51:09
|
Update of /cvsroot/linux-decnet/dnprogs/contrib/ph3-der-loewe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21431 Modified Files: dnetstat.c Log Message: Show object names if -n not specified Index: dnetstat.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/contrib/ph3-der-loewe/dnetstat.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dnetstat.c 5 Sep 2008 14:02:47 -0000 1.2 --- dnetstat.c 17 Sep 2008 11:50:44 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- #include <stdio.h> + #include <stdlib.h> #include <string.h> #include <errno.h> *************** *** 48,51 **** --- 49,75 ---- } + char * object_name(char *number) { + int objnum = atoi(number); + + if (numeric) + return number; + + switch(objnum) { + case 17: return "FAL"; + case 18: return "HLD"; + case 19: return "NML"; + case 23: return "REMACP"; + case 25: return "MIRROR"; + case 26: return "EVL"; + case 27: return "MAIL"; + case 29: return "PHONE"; + case 42: return "CTERM"; + case 51: return "VPM"; + case 63: return "DTR"; + default: + return number; + } + } + int prep_addr (char * buf, char * object) { struct nodeent * ne; *************** *** 68,72 **** strcat(buf, "*"); } else { ! strcat(buf, object); } return 0; --- 92,96 ---- strcat(buf, "*"); } else { ! strcat(buf, object_name(object)); } return 0; |
From: Christine C. <chr...@us...> - 2008-09-17 03:53:06
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29656 Modified Files: nml.c Log Message: Show active links Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** nml.c 12 Sep 2008 10:20:29 -0000 1.7 --- nml.c 17 Sep 2008 10:53:00 -0000 1.8 *************** *** 60,63 **** --- 60,70 ---- static unsigned short adj_node[MAX_ADJACENT_NODES]; + static int num_link_nodes = 0; + static struct link_node + { + unsigned char node, area; + unsigned int links; + } link_nodes[MAX_ADJACENT_NODES]; + static void makeupper(char *s) { *************** *** 138,141 **** --- 145,163 ---- } + static int get_link_count(unsigned char addr1, unsigned char addr2) + { + int node = addr1 | (addr2<<8 & 0x3); + int area = addr2 >> 2; + int i; + + for (i=0; i<num_link_nodes; i++) { + if (link_nodes[i].area == area && + link_nodes[i].node == node) { + return link_nodes[i].links; + } + } + return 0; + } + static int send_node(int sock, struct nodeent *n, int exec, char *device, int state) { *************** *** 170,173 **** --- 192,196 ---- struct nodeent scratch_n; unsigned char scratch_na[2]; + int links; scratch_na[0] = router_node & 0xFF; *************** *** 177,181 **** buf[ptr++] = 0; ! buf[ptr++] = 0x81; // Data type of 'state' buf[ptr++] = state; --- 200,204 ---- buf[ptr++] = 0; ! buf[ptr++] = 0x81; // Data type & length of 'state' buf[ptr++] = state; *************** *** 214,217 **** --- 237,251 ---- buf[ptr++] = 0;// No Name } + + // Also show the number of active links + links = get_link_count(n->n_addr[0], n->n_addr[1]); + if (links) { + buf[ptr++] = 0x58; // 600=Active links + buf[ptr++] = 0x2; // Unsigned decimal + + buf[ptr++] = 2; // Data length + buf[ptr++] = links & 0xFFFF; + buf[ptr++] = links >> 16; + } } } *************** *** 370,373 **** --- 404,470 ---- } + /* + * We read /proc/net/decnet and fill in the number of links to each node + * that we find + */ + static int count_links(void) + { + char buf[256]; + char var1[32]; + char var2[32]; + char var3[32]; + char var4[32]; + char var5[32]; + char var6[32]; + char var7[32]; + char var8[32]; + char var9[32]; + char var10[32]; + char var11[32]; + int i; + FILE *procfile = fopen("/proc/net/decnet", "r"); + + if (!procfile) + return 0; + + while (!feof(procfile)) + { + fgets(buf, sizeof(buf), procfile); + if (sscanf(buf, "%s %s %s %s %s %s %s %s %s %s %s\n", + var1,var2,var3,var4,var5,var6,var7,var8, var9, var10, var11) == 11) { + int area, node; + struct link_node *lnode = NULL; + + /* In case we ever do "SHOW KNOWN LINKS: + * var10 is remote user, var5 is local user + */ + sscanf(var6, "%d.%d\n", &area, &node); + + /* Ignore 0.0 links (listeners) and anything not in RUN state */ + if (area == 0 || node == 0 || strcmp(var11, "RUN")) + continue; + + for (i=0; i<num_link_nodes; i++) { + if (link_nodes[i].area == area && + link_nodes[i].node == node) { + lnode = &link_nodes[i]; + break; + } + } + if (!lnode && i < MAX_ADJACENT_NODES) { + lnode = &link_nodes[num_link_nodes++]; + lnode->area = area; + lnode->node = node; + } + if (lnode) { + lnode->links++; + } + } + } + fclose(procfile); + return 0; + + } + static int read_information(int sock, unsigned char *buf, int length) { *************** *** 394,401 **** case 16: // nodes char case 32: // nodes state ! if (entity == 0xff) send_all_nodes(sock, option & 0x80); ! if (entity == 0xfc) get_neighbour_nodes(sock, send_neigh); if (entity == 0x00) send_exec(sock); --- 491,502 ---- case 16: // nodes char case 32: // nodes state ! if (entity == 0xff) { // KNOWN NODES ! count_links(); send_all_nodes(sock, option & 0x80); ! } ! if (entity == 0xfc) { // ADJACENT NODES ! count_links(); get_neighbour_nodes(sock, send_neigh); + } if (entity == 0x00) send_exec(sock); |
From: Christine C. <chr...@us...> - 2008-09-12 10:20:36
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19873 Modified Files: nml.c Log Message: Show architecture in ID string Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** nml.c 6 Sep 2008 15:02:49 -0000 1.6 --- nml.c 12 Sep 2008 10:20:29 -0000 1.7 *************** *** 157,161 **** if (device) { buf[ptr++] = 0x36; // ! buf[ptr++] = 0x3; // CIRCUIT buf[ptr++] = 0x40; // ASCII text buf[ptr++] = strlen(device); --- 157,162 ---- if (device) { buf[ptr++] = 0x36; // ! buf[ptr++] = 0x3; // 822=CIRCUIT ! buf[ptr++] = 0x40; // ASCII text buf[ptr++] = strlen(device); *************** *** 173,178 **** scratch_na[1] = router_node >>8; ! buf[ptr++] = 0; // Node state buf[ptr++] = 0; buf[ptr++] = 0x81; // Data type of 'state' buf[ptr++] = state; --- 174,180 ---- scratch_na[1] = router_node >>8; ! buf[ptr++] = 0; // 0=Node state buf[ptr++] = 0; + buf[ptr++] = 0x81; // Data type of 'state' buf[ptr++] = state; *************** *** 194,198 **** } ! buf[ptr++] = 0x3e; // 830 NEXT NODE buf[ptr++] = 0x03; --- 196,200 ---- } ! buf[ptr++] = 0x3e; // 830=NEXT NODE buf[ptr++] = 0x03; *************** *** 221,228 **** uname(&un); ! sprintf(ident, "%s V%s", IDENT_STRING, un.release); buf[ptr++] = 0x64; ! buf[ptr++] = 0; // Node identification buf[ptr++] = 0x40; // ASCII text buf[ptr++] = strlen(ident); --- 223,231 ---- uname(&un); ! sprintf(ident, "%s V%s on %s", IDENT_STRING, un.release, un.machine); buf[ptr++] = 0x64; ! buf[ptr++] = 0; // 100=Identification ! buf[ptr++] = 0x40; // ASCII text buf[ptr++] = strlen(ident); |
From: Christine C. <chr...@us...> - 2008-09-12 09:51:38
|
Update of /cvsroot/linux-decnet/dnprogs/libdaemon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8375 Modified Files: dnet_daemon.c Log Message: optdata length should be in network byte order. Index: dnet_daemon.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/libdaemon/dnet_daemon.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** dnet_daemon.c 20 Aug 2008 12:43:59 -0000 1.12 --- dnet_daemon.c 12 Sep 2008 09:51:35 -0000 1.13 *************** *** 976,980 **** optdata.opt_sts=status; ! optdata.opt_optl=len; if (len && data) memcpy(optdata.opt_data, data, len); --- 976,980 ---- optdata.opt_sts=status; ! optdata.opt_optl=dn_htons(len); if (len && data) memcpy(optdata.opt_data, data, len); *************** *** 994,998 **** optdata.opt_sts=status; ! optdata.opt_optl=len; if (data && len) memcpy(optdata.opt_data, data, len); setsockopt(sockfd, DNPROTO_NSP, DSO_DISDATA, --- 994,998 ---- optdata.opt_sts=status; ! optdata.opt_optl=dn_htons(len); if (data && len) memcpy(optdata.opt_data, data, len); setsockopt(sockfd, DNPROTO_NSP, DSO_DISDATA, *************** *** 1016,1020 **** { #ifndef DSO_ACCEPTMODE ! optdata.opt_optl=len; optdata.opt_sts=0; if (len && data) memcpy(optdata.opt_data, data, len); --- 1016,1020 ---- { #ifndef DSO_ACCEPTMODE ! optdata.opt_optl=dn_htons(len); optdata.opt_sts=0; if (len && data) memcpy(optdata.opt_data, data, len); |
From: Christine C. <chr...@us...> - 2008-09-11 13:36:06
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2476 Modified Files: session.cc Log Message: add include <limits.h> to make it compile on Fedora Index: session.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/session.cc,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -r1.45 -r1.46 *** session.cc 20 Aug 2008 13:10:23 -0000 1.45 --- session.cc 11 Sep 2008 13:36:01 -0000 1.46 *************** *** 19,22 **** --- 19,23 ---- #include <sys/stat.h> #include <sys/time.h> + #include <limits.h> #include <stdio.h> #include <errno.h> |
From: Christine C. <chr...@us...> - 2008-09-06 15:16:01
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8084 Modified Files: Makefile Log Message: make dist earlier on in RPM building so the 'clean' doesn't destroy the build tree Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** Makefile 6 Sep 2008 15:13:02 -0000 1.38 --- Makefile 6 Sep 2008 15:15:58 -0000 1.39 *************** *** 71,74 **** --- 71,75 ---- rm -rf rpmbuild BUILD RPMS SOURCES make clean + make dist echo "%_topdir `pwd`" > .rpmmacros echo "`rpm --showrc|grep \^macrofiles`:`pwd`/.rpmmacros" >.rpmrc *************** *** 77,81 **** find `pwd`/rpmbuild/usr/share/man/ -type f|xargs gzip -9 ln -sf libdnet.so.2 rpmbuild/usr/lib/libdnet.so.1 - make dist mkdir SOURCES SRPMS cp /var/tmp/$(PKGNAME)-$(VERSION).tar.gz SOURCES --- 78,81 ---- |
From: Christine C. <chr...@us...> - 2008-09-06 15:13:06
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6777 Modified Files: Makefile Log Message: do a clean before a 'make dist' so I don't leave binaries in the tarball, sigh Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** Makefile 5 Sep 2008 08:19:44 -0000 1.37 --- Makefile 6 Sep 2008 15:13:02 -0000 1.38 *************** *** 47,51 **** # Make the distribution tar file # ! dist: cp debian/changelog NEWS for i in $(SUBDIRS); do cd $$i; rm -f .depend; cd ..; done --- 47,51 ---- # Make the distribution tar file # ! dist: clean cp debian/changelog NEWS for i in $(SUBDIRS); do cd $$i; rm -f .depend; cd ..; done |
From: Christine C. <chr...@us...> - 2008-09-06 15:10:16
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5745 Modified Files: rpm.spec Log Message: Add contributed programs Index: rpm.spec =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/rpm.spec,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** rpm.spec 5 Sep 2008 08:12:43 -0000 1.19 --- rpm.spec 6 Sep 2008 15:10:12 -0000 1.20 *************** *** 38,41 **** --- 38,43 ---- %%PREFIX%%/bin/dnlogin %%PREFIX%%/bin/phone + %%PREFIX%%/bin/dnetcat + %%PREFIX%%/bin/dnetstat %%PREFIX%%/sbin/ctermd %%PREFIX%%/sbin/rmtermd *************** *** 64,67 **** --- 66,71 ---- %%PREFIX%%/share/man/man1/dnping.1.gz %%PREFIX%%/share/man/man1/dnlogin.1.gz + %%PREFIX%%/share/man/man1/dnetcat.1.gz + %%PREFIX%%/share/man/man1/dnetstat.1.gz %%PREFIX%%/share/man/man5/decnet.conf.5.gz %%PREFIX%%/share/man/man5/decnet.proxy.5.gz |
From: Christine C. <chr...@us...> - 2008-09-06 15:03:10
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2483/debian Modified Files: changelog dnet-progs.files Log Message: Fix typo Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** changelog 6 Sep 2008 13:04:18 -0000 1.65 --- changelog 6 Sep 2008 15:03:04 -0000 1.66 *************** *** 4,8 **** * Add dnetcat & dnetstat programs thanks to Philipp 'ph3-der-loewe' Schafft ! * Executable are now correctly stripped -- Christine Caulfield <Chr...@go...> Sat, 06 Sep 2008 13:48:58 +0100 --- 4,8 ---- * Add dnetcat & dnetstat programs thanks to Philipp 'ph3-der-loewe' Schafft ! * Executables are now correctly stripped by dh_strip -- Christine Caulfield <Chr...@go...> Sat, 06 Sep 2008 13:48:58 +0100 Index: dnet-progs.files =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.files,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** dnet-progs.files 5 Sep 2008 08:12:43 -0000 1.10 --- dnet-progs.files 6 Sep 2008 15:03:04 -0000 1.11 *************** *** 22,25 **** --- 22,27 ---- ./usr/bin/dnlogin ./usr/bin/dntask + ./usr/bin/dnetcat + ./usr/bin/dnetstat ./usr/bin/phone ./usr/share/doc/dnet-progs/dnetd.README *************** *** 50,53 **** --- 52,57 ---- ./usr/share/man/man1/dnprint.1 ./usr/share/man/man1/dntask.1 + ./usr/share/man/man1/dnetcat.1 + ./usr/share/man/man1/dnetstat.1 ./usr/share/man/man1/phone.1 ./usr/share/man/man1/dnsubmit.1 |
From: Christine C. <chr...@us...> - 2008-09-06 15:02:52
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2426/nml Modified Files: nml.c Log Message: Make router display work in big-endian systems Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** nml.c 6 Sep 2008 13:53:00 -0000 1.5 --- nml.c 6 Sep 2008 15:02:49 -0000 1.6 *************** *** 134,139 **** } fclose(procfile); ! if (verbose) ! fprintf(stderr, "Router node is %x\n", router); return router; } --- 134,138 ---- } fclose(procfile); ! dnetlog(LOG_DEBUG, "Router node is %x\n", router); return router; } *************** *** 168,171 **** --- 167,175 ---- if (state != NODESTATE_UNKNOWN) { struct nodeent *rn; + struct nodeent scratch_n; + unsigned char scratch_na[2]; + + scratch_na[0] = router_node & 0xFF; + scratch_na[1] = router_node >>8; buf[ptr++] = 0; // Node state *************** *** 179,183 **** if (((n->n_addr[0] | n->n_addr[1]<<8) & 0xFC00) != (router_node & 0xFC00)) { ! rn = getnodebyaddr((char *)&router_node, 2, AF_DECnet); } else { --- 183,192 ---- if (((n->n_addr[0] | n->n_addr[1]<<8) & 0xFC00) != (router_node & 0xFC00)) { ! rn = getnodebyaddr((char *)scratch_na, 2, AF_DECnet); ! if (!rn) { ! rn = &scratch_n; ! scratch_n.n_addr = scratch_na; ! scratch_n.n_name = NULL; ! } } else { *************** *** 194,198 **** buf[ptr++] = 0x40; // ASCII text ! if (rn) { makeupper(rn->n_name); buf[ptr++] = strlen(rn->n_name); --- 203,207 ---- buf[ptr++] = 0x40; // ASCII text ! if (rn && rn->n_name) { makeupper(rn->n_name); buf[ptr++] = strlen(rn->n_name); |
From: Christine C. <chr...@us...> - 2008-09-06 13:53:05
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6638 Modified Files: nml.c Log Message: Show next (router) node Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** nml.c 6 Sep 2008 12:34:34 -0000 1.4 --- nml.c 6 Sep 2008 13:53:00 -0000 1.5 *************** *** 53,56 **** --- 53,58 ---- static struct rtnl_handle listen_rth; static int first_time = 1; + static int verbose; + static unsigned short router_node; #define MAX_ADJACENT_NODES 1024 *************** *** 98,101 **** --- 100,142 ---- } + + /* Get the router address from /proc */ + static unsigned short get_router(void) + { + char buf[256]; + char var1[32]; + char var2[32]; + char var3[32]; + char var4[32]; + char var5[32]; + char var6[32]; + char var7[32]; + char var8[32]; + char var9[32]; + char var10[32]; + char var11[32]; + unsigned short router = 0; + FILE *procfile = fopen("/proc/net/decnet_dev", "r"); + + if (!procfile) + return 0; + while (!feof(procfile)) + { + fgets(buf, sizeof(buf), procfile); + if (sscanf(buf, "%s %s %s %s %s %s %s %s %s ethernet %s\n", + var1,var2,var3,var4,var5,var6,var7,var8,var9,var11) == 10) + { + int area, node; + sscanf(var11, "%d.%d\n", &area, &node); + router = area<<10 | node; + break; + } + } + fclose(procfile); + if (verbose) + fprintf(stderr, "Router node is %x\n", router); + return router; + } + static int send_node(int sock, struct nodeent *n, int exec, char *device, int state) { *************** *** 126,134 **** --- 167,210 ---- /* Node State */ if (state != NODESTATE_UNKNOWN) { + struct nodeent *rn; + buf[ptr++] = 0; // Node state buf[ptr++] = 0; buf[ptr++] = 0x81; // Data type of 'state' buf[ptr++] = state; + + /* For reachable nodes show the next node, ie next router + it itself */ + if (state == NODESTATE_REACHABLE) { + if (((n->n_addr[0] | n->n_addr[1]<<8) & 0xFC00) != + (router_node & 0xFC00)) { + rn = getnodebyaddr((char *)&router_node, 2, AF_DECnet); + } + else { + rn = n; + } + + buf[ptr++] = 0x3e; // 830 NEXT NODE + buf[ptr++] = 0x03; + + buf[ptr++] = 0xc2; // What's this !? + buf[ptr++] = 0x02; // Data type + buf[ptr++] = rn->n_addr[0]; + buf[ptr++] = rn->n_addr[1]; + + buf[ptr++] = 0x40; // ASCII text + if (rn) { + makeupper(rn->n_name); + buf[ptr++] = strlen(rn->n_name); + strcpy(&buf[ptr], rn->n_name); + ptr += strlen(rn->n_name); + } + else { + buf[ptr++] = 0;// No Name + } + } } + + /* Show exec details, name etc */ if (exec) { struct utsname un; *************** *** 167,172 **** } ! /* Save a neighbour entry in a list so we can check it when doing the ! KNOWN NODES display */ static int save_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) --- 243,248 ---- } ! /* Save a neighbour entry in a list so we can check it when doing the ! KNOWN NODES display */ static int save_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) *************** *** 229,232 **** --- 305,310 ---- static int get_neighbour_nodes(int sock, neigh_fn_t neigh_fn) { + router_node = get_router(); + if (first_time) { *************** *** 339,342 **** --- 417,421 ---- int status; + verbose = verbosity; do { |
From: Christine C. <chr...@us...> - 2008-09-06 13:04:21
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20037/debian Modified Files: changelog Log Message: Mention dh_strip Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** changelog 6 Sep 2008 12:59:06 -0000 1.64 --- changelog 6 Sep 2008 13:04:18 -0000 1.65 *************** *** 1,7 **** dnprogs (2.46) unstable; urgency=low ! * Add dnetnml Network Management Listener daemon * Add dnetcat & dnetstat programs thanks to Philipp 'ph3-der-loewe' Schafft -- Christine Caulfield <Chr...@go...> Sat, 06 Sep 2008 13:48:58 +0100 --- 1,8 ---- dnprogs (2.46) unstable; urgency=low ! * Add 'dnetnml' Network Management Listener daemon * Add dnetcat & dnetstat programs thanks to Philipp 'ph3-der-loewe' Schafft + * Executable are now correctly stripped -- Christine Caulfield <Chr...@go...> Sat, 06 Sep 2008 13:48:58 +0100 |
From: Christine C. <chr...@us...> - 2008-09-06 13:03:29
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19587/debian Modified Files: rules Log Message: Call dh_strip after dh_movefiles so it has some files to work on! Index: rules =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/rules,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** rules 7 Dec 2007 11:03:37 -0000 1.24 --- rules 6 Sep 2008 13:03:26 -0000 1.25 *************** *** 81,87 **** dh_installdebconf -Ndnet-common dh_installinit -pdnet-progs --init-script=dnet-progs - dh_strip -Ndnet-common dh_movefiles -Ndnet-common dh_compress -Ndnet-common dh_fixperms -Ndnet-common dh_makeshlibs -Ndnet-common --- 81,87 ---- dh_installdebconf -Ndnet-common dh_installinit -pdnet-progs --init-script=dnet-progs dh_movefiles -Ndnet-common dh_compress -Ndnet-common + dh_strip -Ndnet-common dh_fixperms -Ndnet-common dh_makeshlibs -Ndnet-common |
From: Christine C. <chr...@us...> - 2008-09-06 12:59:10
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17647/debian Modified Files: changelog Log Message: changelog for 2.46 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -r1.63 -r1.64 *** changelog 24 Aug 2008 12:50:56 -0000 1.63 --- changelog 6 Sep 2008 12:59:06 -0000 1.64 *************** *** 1,2 **** --- 1,10 ---- + dnprogs (2.46) unstable; urgency=low + + * Add dnetnml Network Management Listener daemon + * Add dnetcat & dnetstat programs + thanks to Philipp 'ph3-der-loewe' Schafft + + -- Christine Caulfield <Chr...@go...> Sat, 06 Sep 2008 13:48:58 +0100 + dnprogs (2.45) unstable; urgency=low |
From: Christine C. <chr...@us...> - 2008-09-06 12:36:38
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8823 Modified Files: Makefile Log Message: Tidy Makefile Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Makefile 4 Sep 2008 14:34:20 -0000 1.2 --- Makefile 6 Sep 2008 12:36:35 -0000 1.3 *************** *** 4,28 **** PROG1=dnetnml - MANPAGES8=dnetnml.8 - PROG1OBJS=main.o nml.o - CDEFS+=-DPROTOTYPES - CFLAGS+=-I ../dnroute/netlink/include all: $(PROG1) - .c.o: $(CC) $(CFLAGS) $(SYSCONF_PREFIX) -c -o $@ $< ! $(PROG1): $(PROG1OBJS) $(DEPLIBDNET) $(DEPLIBDAEMON) $(UULIB) ! $(CC) $(CFLAGS) -o $@ $(PROG1OBJS) $(LIBDNET) $(LIBUU) $(LIBDAEMON) -L ../dnroute/netlink -lnetlink install: install -d $(prefix)/bin - install -d $(manprefix)/man/man5 install -d $(manprefix)/man/man8 install -m 0755 $(STRIPBIN) $(PROG1) $(prefix)/sbin --- 4,22 ---- PROG1=dnetnml MANPAGES8=dnetnml.8 PROG1OBJS=main.o nml.o CFLAGS+=-I ../dnroute/netlink/include all: $(PROG1) .c.o: $(CC) $(CFLAGS) $(SYSCONF_PREFIX) -c -o $@ $< ! $(PROG1): $(PROG1OBJS) $(DEPLIBDNET) $(DEPLIBDAEMON) ! $(CC) $(CFLAGS) -o $@ $(PROG1OBJS) $(LIBDNET) $(LIBDAEMON) -L ../dnroute/netlink -lnetlink install: install -d $(prefix)/bin install -d $(manprefix)/man/man8 install -m 0755 $(STRIPBIN) $(PROG1) $(prefix)/sbin |
From: Christine C. <chr...@us...> - 2008-09-06 12:34:39
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7994 Modified Files: nml.c Log Message: 'SHOW KNOWN NODES' now also shows reachability state Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** nml.c 4 Sep 2008 15:25:38 -0000 1.3 --- nml.c 6 Sep 2008 12:34:34 -0000 1.4 *************** *** 48,55 **** --- 48,61 ---- #define NODESTATE_UNREACHABLE 5 + typedef int (*neigh_fn_t)(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); + static struct rtnl_handle talk_rth; static struct rtnl_handle listen_rth; static int first_time = 1; + #define MAX_ADJACENT_NODES 1024 + static int num_adj_nodes = 0; + static unsigned short adj_node[MAX_ADJACENT_NODES]; + static void makeupper(char *s) { *************** *** 58,61 **** --- 64,78 ---- } + static int adjacent_node(struct nodeent *n) + { + int i; + unsigned short nodeid = n->n_addr[0] | n->n_addr[1]<<8; + + for (i=0; i<num_adj_nodes; i++) + if (adj_node[i] == nodeid) + return 1; + + return 0; + } static char *if_index_to_name(int ifindex) *************** *** 150,155 **** } ! /* Called for each neighbour node in the list */ ! static int got_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) { struct ndmsg *r = NLMSG_DATA(n); --- 167,194 ---- } ! /* Save a neighbour entry in a list so we can check it when doing the ! KNOWN NODES display ! */ ! static int save_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) ! { ! struct ndmsg *r = NLMSG_DATA(n); ! struct rtattr * tb[NDA_MAX+1]; ! int sock = (int)arg; ! ! memset(tb, 0, sizeof(tb)); ! parse_rtattr(tb, NDA_MAX, NDA_RTA(r), n->nlmsg_len - NLMSG_LENGTH(sizeof ! (*r))); ! ! if (tb[NDA_DST]) ! { ! unsigned char *addr = RTA_DATA(tb[NDA_DST]); ! if (++num_adj_nodes < MAX_ADJACENT_NODES) ! adj_node[num_adj_nodes] = addr[0] | (addr[1]<<8); ! } ! return 0; ! } ! ! /* Called for each neighbour node in the list - send it to the socket */ ! static int send_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) { struct ndmsg *r = NLMSG_DATA(n); *************** *** 188,192 **** /* SHOW ADJACENT NODES */ ! static int send_neighbour_nodes(int sock) { if (first_time) --- 227,231 ---- /* SHOW ADJACENT NODES */ ! static int get_neighbour_nodes(int sock, neigh_fn_t neigh_fn) { if (first_time) *************** *** 206,219 **** /* Calls got_neigh() for each adjacent node */ ! if (rtnl_dump_filter(&listen_rth, got_neigh, (void *)sock, NULL, NULL) < 0) { syslog(LOG_ERR, "Dump terminated: %m\n"); return -1; } ! dnetlog(LOG_DEBUG, "end of send_neighbour_nodes\n"); return 0; } /* SHOW/LIST KNOWN NODES */ ! static int send_perm_nodes(int sock) { void *nodelist; --- 245,258 ---- /* Calls got_neigh() for each adjacent node */ ! if (rtnl_dump_filter(&listen_rth, neigh_fn, (void *)sock, NULL, NULL) < 0) { syslog(LOG_ERR, "Dump terminated: %m\n"); return -1; } ! dnetlog(LOG_DEBUG, "end of get_neighbour_nodes\n"); return 0; } /* SHOW/LIST KNOWN NODES */ ! static int send_all_nodes(int sock, unsigned char perm_only) { void *nodelist; *************** *** 222,225 **** --- 261,269 ---- send_exec(sock); + /* Get adjacent nodes */ + num_adj_nodes = 0; + if (!perm_only) + get_neighbour_nodes(sock, save_neigh); + /* Now iterate the permanent database */ nodelist = dnet_getnode(); *************** *** 228,232 **** { struct nodeent *n = getnodebyname(nodename); ! send_node(sock, n, 0, NULL, NODESTATE_UNKNOWN); nodename = dnet_nextnode(nodelist); } --- 272,277 ---- { struct nodeent *n = getnodebyname(nodename); ! ! send_node(sock, n, 0, NULL, adjacent_node(n)?NODESTATE_REACHABLE:NODESTATE_UNKNOWN); nodename = dnet_nextnode(nodelist); } *************** *** 254,258 **** dnetlog(LOG_DEBUG, "option=%d. entity=%d\n", option, entity); ! switch (option) { case 0: // nodes summary --- 299,303 ---- dnetlog(LOG_DEBUG, "option=%d. entity=%d\n", option, entity); ! switch (option & 0x7f) { case 0: // nodes summary *************** *** 260,268 **** case 32: // nodes state if (entity == 0xff) ! send_perm_nodes(sock); if (entity == 0xfc) ! send_neighbour_nodes(sock); if (entity == 0x00) ! send_exec(sock); // TODO not quite right. break; default: --- 305,313 ---- case 32: // nodes state if (entity == 0xff) ! send_all_nodes(sock, option & 0x80); if (entity == 0xfc) ! get_neighbour_nodes(sock, send_neigh); if (entity == 0x00) ! send_exec(sock); break; default: |
From: Christine C. <chr...@us...> - 2008-09-05 14:02:53
|
Update of /cvsroot/linux-decnet/dnprogs/contrib/ph3-der-loewe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17952 Modified Files: dnetstat.c Log Message: New stuff... Index: dnetstat.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/contrib/ph3-der-loewe/dnetstat.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnetstat.c 5 Sep 2008 08:19:44 -0000 1.1 --- dnetstat.c 5 Sep 2008 14:02:47 -0000 1.2 *************** *** 73,82 **** } ! char * state_ktou (char * state) { if ( strcmp(state, "OPEN") == 0 ) { return "LISTEN"; } else if ( strcmp(state, "RUN") == 0 ) { return "ESTABLISHED"; } else if ( strcmp(state, "RJ") == 0 ) { return "REJECTED"; } else if ( strcmp(state, "DN") == 0 ) { --- 73,84 ---- } ! char * state_ktou (char * state, char ** dir) { if ( strcmp(state, "OPEN") == 0 ) { + *dir = "IN"; return "LISTEN"; } else if ( strcmp(state, "RUN") == 0 ) { return "ESTABLISHED"; } else if ( strcmp(state, "RJ") == 0 ) { + *dir = "OUT"; return "REJECTED"; } else if ( strcmp(state, "DN") == 0 ) { *************** *** 93,96 **** --- 95,100 ---- char state[32], immed[32]; char buf[1024]; + char out[1024] = {0}, * outdir = out+57; + char conid[8] = {0,0,0,0,0,0,0,0}, *lid, *rid; char * lbuf = buf, * rbuf = buf + 512; char * dir = ""; // max be "UNI" or "BI", "IN", "OUT" *************** *** 114,129 **** state, immed ) == 16) { prep_addr(lbuf, local.object); prep_addr(rbuf, remote.object); if ( strcmp(state, "OPEN") != 0 ) { immed[0] = 0; - dir = ""; - } else { - dir = "IN"; } ! printf("decnet %-24s %-24s %-3s %-12s %s\n", lbuf, rbuf, dir, state_ktou(state), immed); } return 0; --- 118,152 ---- state, immed ) == 16) { + lid = index(lbuf, '/') + 1; + rid = index(rbuf, '/') + 1; + + if ( memcmp(lid, conid+4, 4) == 0 && memcmp(rid, conid, 4) == 0 && strcmp(state, "OPEN") != 0 ) { + if ( *out ) { + memcpy(outdir, "LOC", 3); + puts(out); + *out = 0; + continue; + } + } + + if ( *out ) + puts(out); + + memcpy(conid, lid, 4); + memcpy(conid+4, rid, 4); + + prep_addr(lbuf, local.object); prep_addr(rbuf, remote.object); + dir = ""; + if ( strcmp(state, "OPEN") != 0 ) { immed[0] = 0; } ! sprintf(out, "decnet %-24s %-24s %-3s %-12s %s", lbuf, rbuf, dir, state_ktou(state, &dir), immed); } + puts(out); return 0; |
From: Christine C. <chr...@us...> - 2008-09-05 12:46:52
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19803 Modified Files: copynodes.c Log Message: Fix comparison Index: copynodes.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/copynodes.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** copynodes.c 4 Sep 2008 15:50:14 -0000 1.6 --- copynodes.c 5 Sep 2008 12:46:49 -0000 1.7 *************** *** 123,127 **** if (reply[0] == 2) continue; // Success - data to come ! if (reply[0] == -1) { fprintf(stderr, "error %d: %s\n", reply[1] | reply[2]<<8, reply+3); --- 123,127 ---- if (reply[0] == 2) continue; // Success - data to come ! if ((signed char)reply[0] == -1) { fprintf(stderr, "error %d: %s\n", reply[1] | reply[2]<<8, reply+3); |
From: Christine C. <chr...@us...> - 2008-09-05 12:44:37
|
Update of /cvsroot/linux-decnet/dnprogs/contrib/ph3-der-loewe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18963/contrib/ph3-der-loewe Added Files: Makefile Log Message: Fix up Makefile to be the same as others in the project --- NEW FILE: Makefile --- include ../../Makefile.common export TOP=../.. PROG1=dnetcat PROG2=dnetstat MANPAGES1=man1/dnetcat.1 man1/dnetstat.1 PROG1OBJS=dnetcat.o PROG2OBJS=dnetstat.o all: $(PROG1) $(PROG2) $(PROG1): $(PROG1OBJS) $(DEPLIBDNET) $(DEPLIBDAEMON) $(CC) $(CFLAGS) -o $@ $(PROG1OBJS) $(LIBDNET) $(LIBDAEMON) $(PROG2): $(PROG2OBJS) $(DEPLIBDNET) $(UULIB) $(CC) $(CFLAGS) -o $@ $(PROG2OBJS) $(LIBDNET) install: install -d $(prefix)/bin install -d $(manprefix)/man/man1 install -m 0755 $(STRIPBIN) $(PROG1) $(prefix)/bin install -m 0755 $(STRIPBIN) $(PROG2) $(prefix)/bin install -m 0644 $(MANPAGES1) $(manprefix)/man/man1 dep depend: $(CC) $(CFLAGS) -MM *.c >.depend 2>/dev/null clean: rm -f $(PROG1) $(PROG2) *.o *.bak .depend ifeq (.depend,$(wildcard .depend)) include .depend endif |
From: Christine C. <chr...@us...> - 2008-09-05 12:44:37
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18963 Modified Files: Makefile.common Log Message: Fix up Makefile to be the same as others in the project Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** Makefile.common 3 Sep 2008 15:24:50 -0000 1.48 --- Makefile.common 5 Sep 2008 12:44:34 -0000 1.49 *************** *** 67,70 **** --- 67,71 ---- ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) + TOP=.. # # For RPM & DEB builds *************** *** 118,122 **** CC=gcc CDEFS+=-D_XOPEN_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -D_SVID_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ! INCLUDES=-I../libdap -I../include CXXFLAGS+=-pipe -fdollars-in-identifiers -fsigned-char -Wall -Wno-unused -Wno-uninitialized $(INCLUDES) -DVERSION=\"$(VERSION)\" $(CDEFS) $(SHADOWDEFS) $(PTSDEFS) $(DFLAGS) CFLAGS +=-pipe -fsigned-char -Wstrict-prototypes -Wall -Wno-unused -Wno-uninitialized $(INCLUDES) -DVERSION=\"$(VERSION)\" $(CDEFS) $(SHADOWDEFS) $(PTSDEFS) $(DFLAGS) --- 119,123 ---- CC=gcc CDEFS+=-D_XOPEN_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -D_SVID_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ! INCLUDES=-I$(TOP)/libdap -I$(TOP)/include CXXFLAGS+=-pipe -fdollars-in-identifiers -fsigned-char -Wall -Wno-unused -Wno-uninitialized $(INCLUDES) -DVERSION=\"$(VERSION)\" $(CDEFS) $(SHADOWDEFS) $(PTSDEFS) $(DFLAGS) CFLAGS +=-pipe -fsigned-char -Wstrict-prototypes -Wall -Wno-unused -Wno-uninitialized $(INCLUDES) -DVERSION=\"$(VERSION)\" $(CDEFS) $(SHADOWDEFS) $(PTSDEFS) $(DFLAGS) *************** *** 124,140 **** # Conditional for shared/static libs ifdef LINKSTATIC ! LIBDNET=../libdnet/libdnet.a ! LIBDAEMON=../libdaemon/libdnet_daemon.a $(LIBCRYPT) ! LIBDAP=../libdap/libdap.a ! DEPLIBDNET=../libdnet/libdnet.a ! DEPLIBDAEMON=../libdaemon/libdnet_daemon.a ! DEPLIBDAP=../libdap/libdap.a else ! LIBDNET=-L../libdnet -ldnet ! LIBDAP=-L../libdap -ldap ! LIBDAEMON=-L../libdaemon -ldnet_daemon $(LIBCRYPT) ! DEPLIBDNET=../libdnet/libdnet.so ! DEPLIBDAEMON=../libdaemon/libdnet_daemon.so ! DEPLIBDAP=../libdap/libdap.so endif --- 125,141 ---- # Conditional for shared/static libs ifdef LINKSTATIC ! LIBDNET=$(TOP)/libdnet/libdnet.a ! LIBDAEMON=$(TOP)/libdaemon/libdnet_daemon.a $(LIBCRYPT) ! LIBDAP=$(TOP)/libdap/libdap.a ! DEPLIBDNET=$(TOP)/libdnet/libdnet.a ! DEPLIBDAEMON=$(TOP)/libdaemon/libdnet_daemon.a ! DEPLIBDAP=$(TOP)/libdap/libdap.a else ! LIBDNET=-L$(TOP)/libdnet -ldnet ! LIBDAP=-L$(TOP)/libdap -ldap ! LIBDAEMON=-L$(TOP)/libdaemon -ldnet_daemon $(LIBCRYPT) ! DEPLIBDNET=$(TOP)/libdnet/libdnet.so ! DEPLIBDAEMON=$(TOP)/libdaemon/libdnet_daemon.so ! DEPLIBDAP=$(TOP)/libdap/libdap.so endif |
From: Christine C. <chr...@us...> - 2008-09-05 09:05:58
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30737/nml Modified Files: dnetnml.8 Log Message: NML runs quite happily as 'nobody' Index: dnetnml.8 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/dnetnml.8,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnetnml.8 5 Sep 2008 08:12:43 -0000 1.1 --- dnetnml.8 5 Sep 2008 09:05:55 -0000 1.2 *************** *** 17,21 **** by adding the following line to /etc/dnetd.conf: .br ! NML 19 N root dnetnml .br --- 17,21 ---- by adding the following line to /etc/dnetd.conf: .br ! NML 19 N nobody dnetnml .br |
From: Christine C. <chr...@us...> - 2008-09-05 09:05:58
|
Update of /cvsroot/linux-decnet/dnprogs/dnetd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30737/dnetd Modified Files: dnetd.conf Log Message: NML runs quite happily as 'nobody' Index: dnetd.conf =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnetd/dnetd.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dnetd.conf 4 Sep 2008 15:43:09 -0000 1.2 --- dnetd.conf 5 Sep 2008 09:05:55 -0000 1.3 *************** *** 17,21 **** CTERM 42 N root ctermd DTERM 23 N root rmtermd ! NML 19 N root dnetnml * 0 Y none internal --- 17,21 ---- CTERM 42 N root ctermd DTERM 23 N root rmtermd ! NML 19 N nobody dnetnml * 0 Y none internal |
From: Christine C. <chr...@us...> - 2008-09-05 08:19:49
|
Update of /cvsroot/linux-decnet/dnprogs/contrib/ph3-der-loewe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12275/contrib/ph3-der-loewe Added Files: COPYING dnetcat.c dnetstat.c Log Message: Add dnetcat & dnetstat contributed programs. --- NEW FILE: COPYING --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. --- NEW FILE: dnetcat.c --- //dnetcat.c: /* copyright 2008 Philipp 'ph3-der-loewe' Schafft <li...@li...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or version 3. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #include <signal.h> #include <sys/select.h> #include <sys/socket.h> #include <netdnet/dn.h> #include <netdnet/dnetdb.h> char * progname = NULL; void usage (void) { fprintf(stderr, "Usage:\n"); fprintf(stderr, "%s [OPTIONS] node[::] object\n", progname); fprintf(stderr, "or\n"); fprintf(stderr, "%s [OPTIONS] node::object\n", progname); fprintf(stderr, "or\n"); fprintf(stderr, "%s [OPTIONS] -l object\n", progname); fprintf(stderr, "\n"); fprintf(stderr, "Options:\n"); fprintf(stderr, " -h --help this help\n" " -v be verbose\n" " -l listen mode\n" " -f accepts multible connects in listening mode\n" " -z zero IO mode (used for scanning)\n" ); } int main_loop (int local_in, int local_out, int sock) { int len = 1; char buf[1024]; fd_set sl; struct timeval tv; int maxfh = (local_in > sock ? local_in : sock) + 1; while (len > 0) { FD_ZERO(&sl); FD_SET(local_in, &sl); FD_SET(sock, &sl); tv.tv_sec = 1; tv.tv_usec = 0; if (select(maxfh, &sl, NULL, NULL, &tv) > 0) { if ( FD_ISSET(sock, &sl) ) { if ( (len = read(sock, buf, 1024)) == -1 ) return -1; if ( write(local_out, buf, len) != len ) return -1; } else { if ( (len = read(local_in, buf, 1024)) == -1 ) return -1; if ( write(sock, buf, len) != len ) return -1; } } } return 0; } char * localnode (void) { static char node[16] = {0}; struct dn_naddr *binaddr; struct nodeent *dp; if ( !node[0] ) { if ( (binaddr=getnodeadd()) == NULL) return NULL; if ( (dp=getnodebyaddr((char*)binaddr->a_addr, binaddr->a_len, PF_DECnet)) == NULL ) return NULL; strncpy(node, dp->n_name, 15); node[15] = 0; } return node; } int main (int argc, char * argv[]) { int sock; int i; int verbose = 0; int zeroio = 0; int listening = 0; int forking = 0; char * k = NULL; char * node = NULL; char * object = NULL; int objnum = 0; struct sockaddr_dn sockaddr; socklen_t socklen = sizeof(sockaddr); struct nodeent * ne; progname = argv[0]; for (i = 1; i < argc; i++) { k = argv[i]; if ( strcmp(k, "-h") == 0 || strcmp(k, "--help") == 0 ) { usage(); return 0; } else if ( strcmp(k, "-z") == 0 ) { zeroio = 1; } else if ( strcmp(k, "-l") == 0 ) { listening = 1; } else if ( strcmp(k, "-f") == 0 ) { forking = 1; } else if ( strcmp(k, "-v") == 0 ) { verbose++; } else if ( node == NULL ) { node = k; } else if ( object == NULL ) { object = k; } else { usage(); return 1; } } if ( node == NULL ) { fprintf(stderr, "Error: need both, node and object name/number\n"); usage(); return 1; } if ( (k = strstr(node, "::")) != NULL ) { *k = 0; if ( k[2] != 0 && object == NULL ) object = k+2; } if ( listening && node != NULL && object == NULL ) { object = node; node = localnode(); } if ( node == NULL || object == NULL ) { fprintf(stderr, "Error: need both, node and object name/number\n"); usage(); return 1; } if (*object == '#') { objnum = atoi(object+1); } if ( verbose ) { if ( listening ) { // listening on [any] 1234 ... fprintf(stderr, "stening on [any] %i (%s) ...\n", objnum, object); } } errno = 0; if ( listening ) { sock = dnet_daemon(objnum, object, 0, 0); } else { sock = dnet_conn(node, object, SOCK_STREAM, 0, 0, 0, 0); } if ( sock == -1 ) { // localhost [127.0.0.1] 23 (telnet) : Connection refused fprintf(stderr, "%s %i (%s): %s\n", node, objnum, object, strerror(errno)); return 2; } if ( verbose ) { if ( ! listening ) { // localhost [127.0.0.1] 22 (ssh) open fprintf(stderr, "%s %i (%s) open\n", node, objnum, object); } } if ( listening ) { dnet_accept(sock, 0, NULL, 0); if ( verbose ) { memset(&sockaddr, 0, socklen); if ( getpeername(sock, (struct sockaddr*)&sockaddr, &socklen) == 0 ) { if ( sockaddr.sdn_objnum ) sprintf((char*)sockaddr.sdn_objname, "#%u", sockaddr.sdn_objnum); ne = getnodebyaddr((char *)sockaddr.sdn_add.a_addr, sockaddr.sdn_add.a_len, PF_DECnet); fprintf(stderr, "connect to %s::%s from %s::%s \n", node, object, (char*)(ne == NULL ? NULL : ne->n_name), sockaddr.sdn_objname); } else { // connect to [127.0.0.1] from localhost [127.0.0.1] 53255 fprintf(stderr, "connect to %s::%s from unknown \n", node, object); } } } if ( !zeroio ) main_loop(0, 1, sock); if ( listening && !forking ) kill(getppid(), SIGTERM); close(sock); return 0; } //ll --- NEW FILE: dnetstat.c --- //dnetstat.c: /* copyright 2008 Philipp 'ph3-der-loewe' Schafft <li...@li...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or version 3. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/socket.h> #include <fcntl.h> #include <netdnet/dn.h> #include <netdnet/dnetdb.h> #define DNNS_FILE "/proc/net/decnet" struct dn_nse { char node[8]; char object[32]; }; char * progname = NULL; int numeric = 0; void usage (void) { fprintf(stderr, "Usage: %s [OPTIONS]\n", progname); fprintf(stderr, "\n"); fprintf(stderr, "Options:\n"); fprintf(stderr, " -h --help this help\n" " -n numerical mode (do not show node names but addresses)\n" ); } int prep_addr (char * buf, char * object) { struct nodeent * ne; *index(buf, '/') = 0; if ( strcmp(buf, "0.0") == 0 && ! numeric ) { strcpy(buf, "*"); } else if ( !numeric ) { if ( (ne = getnodebyname(buf)) != NULL ) { if ( (ne = getnodebyaddr((const char *)ne->n_addr, ne->n_length, ne->n_addrtype)) != NULL ) { strcpy(buf, ne->n_name); } } } strcat(buf, "::"); if ( strcmp(object, "0") == 0 && ! numeric ) { strcat(buf, "*"); } else { strcat(buf, object); } return 0; } char * state_ktou (char * state) { if ( strcmp(state, "OPEN") == 0 ) { return "LISTEN"; } else if ( strcmp(state, "RUN") == 0 ) { return "ESTABLISHED"; } else if ( strcmp(state, "RJ") == 0 ) { return "REJECTED"; } else if ( strcmp(state, "DN") == 0 ) { return "DISCNOTIFY"; } else if ( strcmp(state, "DIC") == 0 ) { return "DISCONNECTED"; } return state; } int proc_file (FILE * fh) { struct dn_nse local, remote; char state[32], immed[32]; char buf[1024]; char * lbuf = buf, * rbuf = buf + 512; char * dir = ""; // max be "UNI" or "BI", "IN", "OUT" int unused; if ( fgets(buf, 1024, fh) == NULL ) { fprintf(stderr, "Error: can not read banner from file\n"); return -1; } if ( strcmp(buf, "Local Remote\n") != 0 ) { fprintf(stderr, "Error: invalid file format\n"); return -1; } while (fscanf(fh, "%s %04d:%04d %04d:%04d %01d %16s" "%s %04d:%04d %04d:%04d %01d %16s" "%4s %s\n", lbuf, &unused, &unused, &unused, &unused, &unused, local.object, rbuf, &unused, &unused, &unused, &unused, &unused, remote.object, state, immed ) == 16) { prep_addr(lbuf, local.object); prep_addr(rbuf, remote.object); if ( strcmp(state, "OPEN") != 0 ) { immed[0] = 0; dir = ""; } else { dir = "IN"; } printf("decnet %-24s %-24s %-3s %-12s %s\n", lbuf, rbuf, dir, state_ktou(state), immed); } return 0; } int main (int argc, char * argv[]) { FILE * fh = NULL; int i; char * k; char * file = DNNS_FILE; progname = argv[0]; for (i = 1; i < argc; i++) { k = argv[i]; if ( strcmp(k, "-n") == 0 ) { numeric = 1; } else if ( strcmp(k, "-h") == 0 || strcmp(k, "--help") == 0 ) { usage(); return 0; } else { fprintf(stderr, "Error: unknown parameter %s\n", k); usage(); return 1; } } if ( (fh = fopen(file, "r")) == NULL ) { fprintf(stderr, "Error: can not open DECnet netstat file: %s: %s\n", file, strerror(errno)); return 2; } // |Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name // |decnet *::29 *::0 LISTEN IMMED printf("Active DECnet sockets (servers and established)\n"); printf("Proto Local Address Foreign Address Dir State Accept mode\n"); proc_file(fh); fclose(fh); return 0; } //ll |