Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!olivea!apple!portal!fernwood!dumbcat!marc From: marc@dumbcat.sf.ca.us (Marco S Hyman) Newsgroups: comp.unix.sysv386 Subject: Re: uucp using TLI Message-ID: <228@dumbcat.sf.ca.us> Date: 17 Nov 90 19:31:24 GMT References: <1861@ssbn.WLK.COM> Organization: MH Software, Hayward, Ca. Lines: 45 In article <1861@ssbn.WLK.COM> bill@ssbn.WLK.COM (Bill Kennedy) writes: Now you have to work up your network address. We'd have _never_ figured this out without ISC's help! This is a hex string that is composed of address family (AF_INET), port number, IP address, and padding zeroes. Here is the format and an example: \x02000100c0fafa010000000000000000 mapped as aaaappppiiiiiiiizzzzzzzzzzzzzzzz | | | +------------------ sixteen padding zeroes | | +-------------------------- IP address 192.250.250.1 co.fa.fa.01 | +------------------------------ port address fm /etc/services (256) +---------------------------------- address family, socket address Not too suprising. One of the disadvantages of TLI (IMHO) is that the format of the addr field in the t_{bind,call,unitdata,uderr} structures is implementation dependent, e.g. "The responsibility of the transport provider." Since a socket interface library usually (always?) comes with TCP-IP, even when a TLI is used, the address format used is that of a struct sockaddr. Saves having to support multiple address formats, I guess. Anyroad, the format is struct sockaddr { u_short sa_family; /* address family */ char sa_data[14]; /* up to 14 bytes of direct address */ }; in its most generic form. The internet style definition (when sa_family == AF_INET) is: struct sockaddr_in { short sin_family; u_short sin_port; struct in_addr sin_addr; char sin_zero[8]; }; This should look familiar -- it's what you entered above. Isn't it nice to know that when writing code using TLI you have to know who implemented the transport providor protocols to know the address formats to use. // marc -- // marc@dumbcat.sf.ca.us // {ames,decwrl,sun}!pacbell!dumbcat!marc