|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 03-May-2022 | - |
| advio/ | H | 03-Oct-1997 | - | 1,350 | 999 |
| bcast/ | H | 03-Oct-1997 | - | 924 | 674 |
| debug/ | H | 03-Oct-1997 | - | 1,031 | 770 |
| i386-pc-bsdi3.0/ | H | 03-Oct-1997 | - | 828 | 652 |
| icmpd/ | H | 03-May-2022 | - | 1,149 | 860 |
| inetd/ | H | 03-Oct-1997 | - | 517 | 371 |
| intro/ | H | 03-May-2022 | - | 875 | 644 |
| ioctl/ | H | 03-Oct-1997 | - | 744 | 556 |
| ipopts/ | H | 03-Oct-1997 | - | 657 | 478 |
| lib/ | H | 03-May-2022 | - | 4,423 | 3,312 |
| libfree/ | H | 03-May-2022 | - | 662 | 385 |
| libgai/ | H | 03-May-2022 | - | 1,721 | 1,248 |
| libroute/ | H | 03-May-2022 | - | 805 | 594 |
| libxti/ | H | 03-Oct-1997 | - | 2,002 | 1,524 |
| mcast/ | H | 23-Sep-1997 | - | 738 | 531 |
| mysdr/ | H | 03-Oct-1997 | - | 513 | 368 |
| names/ | H | 03-Oct-1997 | - | 1,343 | 1,011 |
| nonblock/ | H | 03-Oct-1997 | - | 1,033 | 768 |
| oob/ | H | 03-Oct-1997 | - | 1,224 | 913 |
| ping/ | H | 03-May-2022 | - | 1,003 | 747 |
| route/ | H | 03-Oct-1997 | - | 951 | 708 |
| rtt/ | H | 03-Oct-1997 | - | 660 | 480 |
| select/ | H | 03-Oct-1997 | - | 610 | 437 |
| server/ | H | 03-Oct-1997 | - | 2,115 | 1,552 |
| sigio/ | H | 03-Oct-1997 | - | 638 | 454 |
| sntp/ | H | 03-Oct-1997 | - | 858 | 630 |
| sock/ | H | 03-Oct-1997 | - | 2,911 | 2,074 |
| sockopt/ | H | 03-Oct-1997 | - | 767 | 566 |
| ssntp/ | H | 06-Jul-1997 | - | 607 | 443 |
| streams/ | H | 03-Oct-1997 | - | 916 | 682 |
| tcpcliserv/ | H | 03-Oct-1997 | - | 1,356 | 990 |
| test/ | H | 03-Oct-1997 | - | 1,140 | 789 |
| threads/ | H | 03-Oct-1997 | - | 1,735 | 1,264 |
| traceroute/ | H | 03-May-2022 | - | 1,158 | 882 |
| udpcksum/ | H | 03-Oct-1997 | - | 936 | 648 |
| udpcliserv/ | H | 03-Oct-1997 | - | 1,051 | 747 |
| unixdomain/ | H | 03-Oct-1997 | - | 1,005 | 741 |
| xtiintro/ | H | 03-Oct-1997 | - | 1,061 | 810 |
| xtioob/ | H | 03-Oct-1997 | - | 921 | 703 |
| xtiopt/ | H | 03-Oct-1997 | - | 1,307 | 1,002 |
| xtiserver/ | H | 11-Jul-1997 | - | 691 | 510 |
| xtiudp/ | H | 03-Oct-1997 | - | 882 | 671 |
| DISCLAIMER | H A D | 11-Jul-1996 | 637 | 12 | 10 |
| Make.defines.in | H A D | 03-May-2022 | 1.4 KiB | 44 | 34 |
| Makefile.in | H A D | 03-May-2022 | 262 | 17 | 12 |
| README | H A D | 03-Oct-1997 | 7.2 KiB | 180 | 132 |
| aclocal.m4 | H A D | 14-Apr-1997 | 4.7 KiB | 214 | 211 |
| config.guess | H A D | 11-Apr-1997 | 19.9 KiB | 694 | 598 |
| config.h.in | H A D | 10-Jul-1997 | 3.2 KiB | 82 | 72 |
| config.sub | H A D | 11-Apr-1997 | 18.8 KiB | 928 | 817 |
| configure | H A D | 03-May-2022 | 125.2 KiB | 4,750 | 4,142 |
| configure.in | H A D | 10-Jul-1997 | 19.9 KiB | 642 | 594 |
| install-sh | H A D | 11-Apr-1997 | 5.5 KiB | 251 | 152 |
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