-#ifdef NS
-short ns_nullh[] = {0,0,0};
-short ns_bh[] = {-1,-1,-1};
-
-char *
-ns_print(sns)
- struct sockaddr_ns *sns;
-{
- struct ns_addr work;
- union { union ns_net net_e; u_long long_e; } net;
- u_short port;
- static char mybuf[50+MAXHOSTNAMELEN], cport[10], chost[25];
- char *host = "";
- register char *p;
- register u_char *q;
-
- work = sns->sns_addr;
- port = ntohs(work.x_port);
- work.x_port = 0;
- net.net_e = work.x_net;
- if (ns_nullhost(work) && net.long_e == 0) {
- if (!port)
- return ("*.*");
- (void) sprintf(mybuf, "*.%XH", port);
- return (mybuf);
- }
-
- if (bcmp((char *)ns_bh, (char *)work.x_host.c_host, 6) == 0)
- host = "any";
- else if (bcmp((char *)ns_nullh, (char *)work.x_host.c_host, 6) == 0)
- host = "*";
- else {
- q = work.x_host.c_host;
- (void) sprintf(chost, "%02X%02X%02X%02X%02X%02XH",
- q[0], q[1], q[2], q[3], q[4], q[5]);
- for (p = chost; *p == '0' && p < chost + 12; p++)
- /* void */;
- host = p;
- }
- if (port)
- (void) sprintf(cport, ".%XH", htons(port));
- else
- *cport = 0;
-
- (void) snprintf(mybuf, sizeof(mybuf), "%lxH.%s%s",
- (unsigned long)ntohl(net.long_e),
- host, cport);
- return (mybuf);
-}
-#endif
-