• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

advio/H03-Oct-1997-1,350999

bcast/H03-Oct-1997-924674

debug/H03-Oct-1997-1,031770

i386-pc-bsdi3.0/H03-Oct-1997-828652

icmpd/H03-May-2022-1,149860

inetd/H03-Oct-1997-517371

intro/H03-May-2022-875644

ioctl/H03-Oct-1997-744556

ipopts/H03-Oct-1997-657478

lib/H03-May-2022-4,4233,312

libfree/H03-May-2022-662385

libgai/H03-May-2022-1,7211,248

libroute/H03-May-2022-805594

libxti/H03-Oct-1997-2,0021,524

mcast/H23-Sep-1997-738531

mysdr/H03-Oct-1997-513368

names/H03-Oct-1997-1,3431,011

nonblock/H03-Oct-1997-1,033768

oob/H03-Oct-1997-1,224913

ping/H03-May-2022-1,003747

route/H03-Oct-1997-951708

rtt/H03-Oct-1997-660480

select/H03-Oct-1997-610437

server/H03-Oct-1997-2,1151,552

sigio/H03-Oct-1997-638454

sntp/H03-Oct-1997-858630

sock/H03-Oct-1997-2,9112,074

sockopt/H03-Oct-1997-767566

ssntp/H06-Jul-1997-607443

streams/H03-Oct-1997-916682

tcpcliserv/H03-Oct-1997-1,356990

test/H03-Oct-1997-1,140789

threads/H03-Oct-1997-1,7351,264

traceroute/H03-May-2022-1,158882

udpcksum/H03-Oct-1997-936648

udpcliserv/H03-Oct-1997-1,051747

unixdomain/H03-Oct-1997-1,005741

xtiintro/H03-Oct-1997-1,061810

xtioob/H03-Oct-1997-921703

xtiopt/H03-Oct-1997-1,3071,002

xtiserver/H11-Jul-1997-691510

xtiudp/H03-Oct-1997-882671

DISCLAIMERH A D11-Jul-1996637 1210

Make.defines.inH A D03-May-20221.4 KiB4434

Makefile.inH A D03-May-2022262 1712

READMEH A D03-Oct-19977.2 KiB180132

aclocal.m4H A D14-Apr-19974.7 KiB214211

config.guessH A D11-Apr-199719.9 KiB694598

config.h.inH A D10-Jul-19973.2 KiB8272

config.subH A D11-Apr-199718.8 KiB928817

configureH A D03-May-2022125.2 KiB4,7504,142

configure.inH A D10-Jul-199719.9 KiB642594

install-shH A D11-Apr-19975.5 KiB251152

README

1QUICK AND DIRTY
2===============
3
4    cd <some-directory-of-your-choosing>
5    gunzip -c unpv12e.tar.gz | tar xvf -
6
7    cd unpv12e
8    ./configure    # try to figure out all implementation differences
9
10    cd lib         # build the basic library that all programs need
11    make           # use "gmake" everywhere on BSD/OS systems
12
13    cd ../libfree  # continue building the basic library
14    make
15
16    cd ../libgai   # the getaddrinfo() and getnameinfo() functions
17    make
18
19    cd ../libroute # only if your system supports 4.4BSD style routing sockets
20    make           # only if your system supports 4.4BSD style routing sockets
21
22    cd ../libxti   # only if your system supports XTI
23    make           # only if your system supports XTI
24
25    cd ../intro    # build and test a basic client program
26    make daytimetcpcli
27    ./daytimetcpcli 127.0.0.1
28
29If all that works, you're all set to start compiling individual programs.
30
31Notice that all the source code assumes tabs every 4 columns, not 8.
32
33MORE DETAILS
34============
35
360.  To extract the source directories from the unpv12e.tar.gz tar file,
37    execute:
38
39	cd <some-directory-of-your-choosing>
40	gunzip -c unpv12e.tar.gz | tar xvf -
41
42    This creates a directory named unpv12e/ containing about 40 other
43    directories.  The names of these 40 other directories are what appears
44    in the horizontal rules that start and end each source code listing
45    in the book.  For example, the file unpv12e/intro/daytimetcpcli.c
46    corresponds to the source code in Figure 1.5 (Page 6) of the book.
47
481.  There is a "unp.h" header that appears in every one of the 40 directories.
49    If you need to make any changes to this "unp.h" header, notice that it
50    is a hard link in each directory, so you only need to change it once.
51    Hard links are also used with the other "unp*.h" headers.
52
532.  I used the GNU autoconf package to generate a shell script named
54    "configure" that you must execute.  This script will try and figure
55    out lots of characteristics of your system.
56
57    This script builds two important files "Make.defines" and "config.h".
58    Each "Makefile" in each of the 40 directories includes "Make.defines",
59    and the first #include done by "unp.h" is of "config.h".
60
61    These two files *must* be set correctly for your system, or you will
62    not be able to build the source code.
63
643.  Go into the "lib/" directory and type "make".  This builds the library
65    "libunp.a" that is required by almost all of the programs.  There may
66    be compiler warnings (see NOTES below).
67
68    Go into the "libfree/" directory and type "make".  This adds to the
69    "libunp.a" library.  Similarly go into the  "libgai", "libroute" and
70    "libxti" directories and "make".  The "libroute" directory should only
71    be used if your system supports 4.4BSD-style routing sockets.  The
72    "libxti" directory should only be used if your system supports XTI
73    (not TLI).
74
754.  Once the library is made, you can then go into any of the source code
76    directories and make whatever program you are interested in.  A good
77    starting poing is the "intro" directory and "make daytimetcpcli".
78
79NOTES
80=====
81
82- I have run most of the programs on the following Unix systems:
83
84	alpha-dec-osf3.2
85	alpha-dec-osf4.0
86	hppa1.1-hp-hpux10.30
87	i386-pc-bsdi3.0
88	i386-univel-sysv4.2MP   (UnixWare 2.1.2)
89	i586-pc-linux-gnu       (RedHat Linux 4.2)
90	powerpc-ibm-aix4.2.0.0
91	sparc-sun-solaris2.5.1
92	sparc-sun-solaris2.6
93	sparc-sun-sunos4.1.4
94
95  These are the names used by the autoconf system to identify the
96  hardware, vendor, and operating system.
97
98  The code should port quite easily to other Unix systems, but I do
99  *NOT* have time to help everyone port the code to different
100  environments.  Please do *NOT* send me email with your "make" output
101  asking me to tell you what to do.
102
103- BEWARE: Not all programs in each directory will compile on all systems
104  (e.g., the file unpv12erc/advio/recvfromflags.c will not compile unless
105  your system supports the IP_RECVDSTADDR socket option).
106
107  Also, not all files in each directory are included in the book.  Beware
108  of any files with "test" in the filename: they are probably a quick test
109  program that I wrote to check something, and may or may not work.
110
111- You may find comments of the form "/* begin FOO */" followed later by
112  a "/* end FOO */".  These delineate pieces of source code for the loom
113  program that includes the source code in the book.  Ignore these.
114
115  Similarly you will encounter comments that begin with "4" or "8".
116  These are used to move the comment to the right by that number of
117  spaces, getting around the GNU indent program.  Ignore these.
118
119- I have included the "sock" program that was introduced with "TCP/IP
120  Illustrated, Volume 1" and also used in this Volume of UNP.  It is in
121  the "sock/" directory.  The code compiles and works, but has never been
122  cleaned up.
123
124- Many systems do not have correct function prototypes for the socket
125  functions, and this can cause many warnings during compilation.
126  For example, Solaris 2.5 omits the "const" from the 2nd argument
127  to connect().  Lots of systems use "int" for the length of socket
128  address structures, while Posix.1g specifies "socklen_t".  Lots of
129  systems still have the pointer argument to [sg]etsockopt() as a
130  "char *" instead of a "void *", and this also causes warnings.
131
132- SunOS 4.1.x: If you are using Sun's acc compiler, you need to run
133  the configure program as
134
135        CC=acc CFLAGS=-w CPPFLAGS=-w ./configure
136
137  Failure to do this results in numerous system headers (<sys/sockio.h>)
138  not being found during configuration, causing compile errors later.
139
140- If your system supports IPv6 and you want to run the examples in the
141  book using hostnames, you must install the latest BIND release.  You
142  can get it from ftp://ftp.vix.com/pub/bind/release.  All you need from
143  this release is a resolver library that you should then add to the
144  LDLIBS and LDLIBS_THREADS lines.
145
146- IPv6 support is still in its infancy.  There may be differences
147  between the IPv6 sockets API specifications and what the vendor
148  provides.  This *WILL* require hand tweaking, but should get better
149  over time.
150
151- If your system supports an older draft of the Posix pthreads standard,
152  but configure detects the support of pthreads, you will have to disable
153  this by hand.  Digital Unix V3.2C has this problem, for example, as it
154  supports draft 4, not the final draft.  AIX 4.2 supports draft 7, not
155  the final standard.
156
157  To fix this, remove wrappthread.o from LIB_OBJS in "Make.defines" and
158  don't try to build and run any of the threads programs.
159
160COMMON DIFFERENCES
161==================
162
163These are the common differences that I see in various headers that are
164not "yet" at the level of Posix.1g or X/Open XNS Issue 5.
165
166- getsockopt() and setsockopt(): 5th argument is not correct type.
167
168- t_bind(): second argument is missing "const".
169
170- t_connect(): second argument is missing "const".
171
172- t_open(): first argument is missing "const".
173
174- t_optmsmg(): second argument is missing "const".
175
176- If your <xti.h> defines the members of the t_opthdr{} as longs,
177  instead of t_uscalar_t, some of the printf formats of these value
178  might generate warnings from your compiler, since you are printing
179  a long without a corresponding long format specifier.
180