🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.d
Article #90

NN, Network Byte Order, and Sockets

#90
From: Steve C. Simmons
Date: Tue, 27 Jun 1989 19:45
40 lines
1871 bytes
A problem with NN on 4.3BSD vaxen:

In nntp.c, the inclusion of <netinet/in.h> is controlled by the ifdef
of NETWORK_BYTE_ORDER.  The m-vax.h file specificly undefines this,
yet it's clear from the code that nntp.c will never compile without
netinet/in.h.  Since all our hosts are vaxes network byte order isn't
really an issue, so I patched as below and it compiled and ran.  Is
this ifdef as bogus as it looks?

Other compilation issues: using gcc I got boatloads of warning messages
about functions at first defined as extern then later as static.
Doing a quick reshuffle on the code took care of the messages, but
I didn't bother with more than a couple of modules.  Also, gcc did
some heavy barfing when building the initial makefile.  As chip rosenthal
mentioned in his posting, changing the string

* this is probably non-portable so it is ifdef'ed

to remove the apostrophe fixes it.

Comments -- nn is a nice little package.  It has cut down on how long
I spend reading news, which sure seem to be the intent.

Patch follows.

*** orig/nntp.c	Sun Jun 25 20:34:45 1989
--- nntp.c	Tue Jun 27 09:36:02 1989
***************
*** 32,40 ****
  #include <netdb.h>
  
  /* This is necessary due to the definitions in m-XXX.h */
- #ifdef NETWORK_BYTE_ORDER
  #include <netinet/in.h>
- #endif
  
  export char nntp_server[256];	/* name of nntp server */
  export int use_nntp = 0;	/* bool: t iff we use nntp */
--- 32,38 ----
Technical Details
Message-ID: <1831@itivax.iti.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!itivax!itivax.iti.org!scs

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!itivax!itivax.iti.org!scs
From: scs@itivax.iti.org (Steve C. Simmons)
Newsgroups: comp.sources.d
Subject: NN, Network Byte Order, and Sockets
Message-ID: <1831@itivax.iti.org>
Date: 27 Jun 89 19:45:24 GMT
Sender: scs@itivax.iti.org
Reply-To: scs@itivax.iti.org (Steve C. Simmons)
Organization: Industrial Technology Institute
Lines: 40