PDP-10 / supdup

Community maintained SUPDUP client for Unix
Other
16 stars 8 forks source link

Chaosnet domain name is added to hostname. #31

Closed larsbrinkhoff closed 12 months ago

larsbrinkhoff commented 1 year ago

If the hostname doesn't have a period (".") in it, supdup adds the default Chaosnet domain name ".chaosnet.net" to it. This is passed along to the bridge NCP, which is a bit of a problem for the NCP looking up hostnames in a hosts file. @bictorv, ideas?

bictorv commented 1 year ago

Yes, it seems like a bad idea but probably precedes the NCP default domain setting. It seems simple: just don't add the default domain.

But the host name parsing has another function: to check if Supdup should use Chaos or TCP. I would suggest introducing another program option for that (e.g. "-c"), or possibly first try to connect with Chaos, and if there is no cbridge or the cbridge gives back a LOS, proceed with TCP. It should be quick enough.

bictorv commented 1 year ago

And it is a problem even if the NCP doesn't look up hostnames in a hosts file. Having several different defaults (in Supdup, in the NCP) makes it more difficult to predict.

larsbrinkhoff commented 12 months ago

I think I will have to do some rewriting. The current logic is approximately this:

  1. Look up hostname. First try Chaosnet, then Internet.
  2. If lookup is not ok and interactive hostname entry, go back to 1.
  3. Make connection to Chaosnet or Internet depending on which succeeded in step 1.

I propose the rewrite:

  1. Look up Chaosnet hostname. If ok, try to connect to Chaosnet address.
  2. If lookup or connection is not ok, try to look up Internet hostname and connect to that.
  3. If neither Chaosnet or Internet ok and interactive hostname entry, go back to 1.

Note to self: add Arpanet later.

bictorv commented 12 months ago

But how do you propose to do the Chaosnet host lookup? Wouldn't it be better to let the cbridge NCP do that, i.e.

  1. Try to connect to the hostname, if there is one.
  2. if connection is not OK, look up Internet hostname and connect to that.
  3. if interactive hostname entry, get one and go back to 1
larsbrinkhoff commented 12 months ago

Yes. As far as supdup is concerned, the "network modules" should ideally only accept a hostname string and return a file descriptor or -1. Or something like that, depending on implementation details. The current code is a little hairy, so we'll see how it goes.

bictorv commented 12 months ago

The current code is pretty horrible and the whole thing should be rewritten, I think?

larsbrinkhoff commented 12 months ago

The hostname resolving and connection, yes. I don't think there's any small elegant patch that can make this better.

larsbrinkhoff commented 12 months ago

To be fair, it was ok when there was only one kind of network to worry about.

larsbrinkhoff commented 12 months ago

Fixed by #32.

bictorv commented 12 months ago

The hostname resolving and connection, yes. I don't think there's any small elegant patch that can make this better.

No, I mean the whole program is pretty horrible (like so much C code from the 1980s). Except the new chaos.c and tcp.c, of course.