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

..03-May-2022-

man/H14-Nov-2003-463374

win/H03-May-2022-1,241891

AUTHORSH A D31-May-200191 63

COPYINGH A D31-May-200117.6 KiB343281

Carbon.rH A D31-May-2001355 1914

ChangeLogH A D14-Nov-2003357 1312

INSTALLH A D13-Nov-20038.5 KiB211161

Makefile.amH A D13-Nov-2003472 3328

Makefile.inH A D14-Nov-200313.7 KiB452352

NEWSH A D13-Nov-2003292 158

READMEH A D13-Nov-20037.2 KiB223165

README.Mac-WinH A D01-Mar-20022.1 KiB5539

acconfig.hH A D13-Nov-2003961 4025

aclocal.m4H A D14-Nov-20034.3 KiB128113

bitcount.cH A D13-Nov-20031 KiB4316

bitcount.hH A D13-Nov-2003881 294

bitfill.cH A D13-Nov-20031.9 KiB7028

bitfill.hH A D13-Nov-2003939 315

config.h.inH A D13-Nov-20031.5 KiB6347

configureH A D14-Nov-200358.4 KiB1,9041,500

configure.inH A D14-Nov-20031.4 KiB6148

ctonm.cH A D13-Nov-20031.7 KiB7130

ctonm.hH A D13-Nov-20031.3 KiB5421

install-shH A D31-May-20015.5 KiB252153

main.cH A D13-Nov-20035.8 KiB223147

main.hH A D13-Nov-20031.2 KiB5722

missingH A D31-May-20016.1 KiB191154

mkinstalldirsH A D31-May-2001721 4123

myTypes.hH A D13-Nov-2003989 346

myname.hH A D13-Nov-20031 KiB379

nmtoc.cH A D13-Nov-20031.9 KiB8033

octets.cH A D13-Nov-20032.4 KiB9949

octets.hH A D13-Nov-20031 KiB377

printdata.cH A D13-Nov-20031.7 KiB6328

printdata.hH A D13-Nov-2003931 295

stamp-h.inH A D14-Nov-200310 21

usage.cH A D13-Nov-20032.7 KiB7943

usage.hH A D13-Nov-2003905 344

validatemask.cH A D13-Nov-20031.5 KiB5724

validatemask.hH A D13-Nov-2003894 284

whatnet.cH A D13-Nov-20036.4 KiB229145

whatnet.hH A D13-Nov-2003979 345

whatnet_printdata.cH A D13-Nov-20032.3 KiB7936

whatnet_printdata.hH A D13-Nov-2003999 295

README

1Whatmask v1.2
2=====================================
3Nov. 14, 2003
4
5By: Joe Laffey <joe@laffeycomputer.com>
6Updates: http://www.laffeycomputer.com/software.html
7<c> 2000-2003 Joe Laffey.
8Subject to the terms of the GPL.
9
10========
11Whatmask
12========
13
14Whatmask is a small C program that will help you with network settings.
15
16Whatmask can work in two modes. The first mode (which is how prior versions
17worked) is to invoke Whatmask with only a subnet mask as the argument. In
18this mode Whatmask will echo back the subnet mask in four formats, plus
19the number of useable addresses in the range.
20
21Netmask Notations supported:
22
23 Name                  Example
24---------------------------------
25 CIDR                         /24
26 Netmask            255.255.255.0
27 Hex Netmask           0xffffff00
28 Wilcard Bits           0.0.0.255
29
30
31The above notations are all identical. CIDR notation commonly has a "/" in
32front of the number (representing the number of bits). Whatmask can accept
33these notations with or without a slash. This notation is used more and more
34recently. A lot of popular routers and software support this notation.
35
36Netmask notation is pretty much the standard old-school way of doing it. It
37is supported by most systems (Un*x, Win, Mac, etc.).
38
39Netmasks are sometimes represented as hexadecimal values, especially in
40the BSD, such as NetBSD (http://www.netbsd.org/), my favorite.
41
42Wilcard bits are similar to the netmask, but they are the logical not of the
43netmask. This notation is used by a number of popular routers (and nobody
44knows why...).
45
46To use Whatmask in the original mode simply type "whatmask <notation>" The
47notation can be in any of the four formats, and Whatmask will automagically
48figure out what it is and display all four notations.
49
50To find out more about subnets and netmasks see the References section below.
51
52To use Whatmask in its second mode execute Whatmask with any ip address
53within the subnet, followed by a slash ('/'), followed by the subnet mask in
54any format. (e.g. 192.168.0.23/255.255.255.224, or 192.168.0.23/27)
55
56Whatmask will echo back the following:
57
58- The netmask in the following formats: CIDR, Netmask, Hex, Wildcard Bits
59- The Network Address
60- The Broadcast Address
61- The number of Usable IP Addresses
62- The First Usable IP Address
63- The Last Usable IP Address
64
65(Whatnet assumes that the Broadcast address is the highest address in the
66subnet. This is the most common configuration.)
67
68
69
70
71Whatnet Examples
72================
73
74myhost> whatmask /26
75
76---------------------------------------------
77       TCP/IP SUBNET MASK EQUIVALENTS
78---------------------------------------------
79CIDR = .....................: /26
80Netmask = ..................: 255.255.255.192
81Netmask (hex) = ............: 0xffffffc0
82Wildcard Bits = ............: 0.0.0.63
83Usable IP Addresses = ......: 62
84
85
86myhost> whatmask 255.255.192.0
87
88---------------------------------------------
89       TCP/IP SUBNET MASK EQUIVALENTS
90---------------------------------------------
91CIDR = .....................: /18
92Netmask = ..................: 255.255.192.0
93Netmask (hex) = ............: 0xffffc000
94Wildcard Bits = ............: 0.0.63.255
95Usable IP Addresses = ......: 16382
96
97
98myhost> whatmask 0xffffffe0
99
100---------------------------------------------
101       TCP/IP SUBNET MASK EQUIVALENTS
102---------------------------------------------
103CIDR = .....................: /27
104Netmask = ..................: 255.255.255.224
105Netmask (hex) = ............: 0xffffffe0
106Wildcard Bits = ............: 0.0.0.31
107Usable IP Addresses = ......: 30
108
109
110myhost> whatmask 0.0.0.31
111
112---------------------------------------------
113       TCP/IP SUBNET MASK EQUIVALENTS
114---------------------------------------------
115CIDR = .....................: /27
116Netmask = ..................: 255.255.255.224
117Netmask (hex) = ............: 0xffffffe0
118Wildcard Bits = ............: 0.0.0.31
119Usable IP Addresses = ......: 30
120
121
122
123myhost> whatmask 192.168.165.23/19
124
125------------------------------------------------
126           TCP/IP NETWORK INFORMATION
127------------------------------------------------
128IP Entered = ..................: 192.168.165.23
129CIDR = ........................: /19
130Netmask = .....................: 255.255.224.0
131Netmask (hex) = ...............: 0xffffe000
132Wildcard Bits = ...............: 0.0.31.255
133------------------------------------------------
134Network Address = .............: 192.168.160.0
135Broadcast Address = ...........: 192.168.191.255
136Usable IP Addresses = .........: 8190
137First Usable IP Address = .....: 192.168.160.1
138Last Usable IP Address = ......: 192.168.191.254
139
140
141myhost> whatmask 192.168.0.13/255.255.255.0
142
143------------------------------------------------
144           TCP/IP NETWORK INFORMATION
145------------------------------------------------
146IP Entered = ..................: 192.168.0.13
147CIDR = ........................: /24
148Netmask = .....................: 255.255.255.0
149Netmask (hex) = ...............: 0xffffff00
150Wildcard Bits = ...............: 0.0.0.255
151------------------------------------------------
152Network Address = .............: 192.168.0.0
153Broadcast Address = ...........: 192.168.0.255
154Usable IP Addresses = .........: 254
155First Usable IP Address = .....: 192.168.0.1
156Last Usable IP Address = ......: 192.168.0.254
157
158
159myhost> whatmask 192.168.1.126/0xffffffe0
160
161------------------------------------------------
162           TCP/IP NETWORK INFORMATION
163------------------------------------------------
164IP Entered = ..................: 192.168.1.126
165CIDR = ........................: /27
166Netmask = .....................: 255.255.255.224
167Netmask (hex) = ...............: 0xffffffe0
168Wildcard Bits = ...............: 0.0.0.31
169------------------------------------------------
170Network Address = .............: 192.168.1.96
171Broadcast Address = ...........: 192.168.1.127
172Usable IP Addresses = .........: 30
173First Usable IP Address = .....: 192.168.1.97
174Last Usable IP Address = ......: 192.168.1.126
175
176
177myhost> whatmask 192.168.0.169/0.0.0.127
178
179------------------------------------------------
180           TCP/IP NETWORK INFORMATION
181------------------------------------------------
182IP Entered = ..................: 192.168.0.169
183CIDR = ........................: /25
184Netmask = .....................: 255.255.255.128
185Netmask (hex) = ...............: 0xffffff80
186Wildcard Bits = ...............: 0.0.0.127
187------------------------------------------------
188Network Address = .............: 192.168.0.128
189Broadcast Address = ...........: 192.168.0.255
190Usable IP Addresses = .........: 126
191First Usable IP Address = .....: 192.168.0.129
192Last Usable IP Address = ......: 192.168.0.254
193
194
195
196COMPILATION NOTE: Some users have reported problems with pre-release versions
197of gcc. If you get "illegal instruction" errors please try compiling with an
198official full release of your compiler. You may also try disabling the
199optimizer by removing "-O2" from the Makefile after running configure.
200
201
202
203References
204==========
205
206O'Reilly and Associates:
207TCP/IP Network Administration, 2nd Edition
208By Craig Hunt
2092nd Edition December 1997
2101-56592-322-7
211http://www.ora.com/
212
213Cisco - IP Addressing and Subnetting for New Users
214http://www.cisco.com/warp/public/701/3.html
215
216More info on Wilcard bits and Cisco routers.
217http://www.delmar.edu/Courses/ITSC1391/Sem3/6ACLs.htm
218
219Then of course you can do a net search... I like http://www.google.com/
220
221
222That's all, folks!
223

README.Mac-Win

1Windows users:
2
3Binaries of Whatmask for Windows are available from:
4http://www.laffeycomputer.com/whatmask.html
5
6If you wish to compile the source yourself the CodeWarrior6 project files
7have been included in the "win" directory. These files will actually compile
8for Windows and Mac OS. The Windows targets are the ones without the word "Mac"
9in them (duh).
10
11If you do not use CodeWarrior you are on your own; however these programs
12should compile easily under any environment. You may need to include the
13following:
14
15#define  __dest_os	 __win32_os
16
17
18
19Mac users:
20
21Precompiled Binaries of Whatmask for Mac OS (Classic/OS X Carbon,
22and OS X command line)  are available from:
23http://www.laffeycomputer.com/whatmask.html
24
25If you wish to compile the source yourself the CodeWarrior6 project files
26have been included in the "win" directory (sorry for the name). These
27files will actually compile for Windows and Mac OS. The Mac targets are
28the ones with the word "Mac" in them (duh). The Mac OS version compiled by
29CodeWarrior is the Carbon version that runs in its own window under Mac OS
30Classic (OS 8 or 9) and OS X. Note that you may get some warnings about
31files not in the hierarchy when you open the project. These are the Windows
32lib files that CW will relocate for you (if you installed the Windows support
33on your Mac). I have not tried to open the project on a machine without
34the Windows support installed; however, CW should at least let you build the
35Mac targets...
36
37If you wish to compile a command line version (for use from the Terminal
38window) for Mac OS X (which is the recommended method for OS X) simply follow
39the UN*X instructions in the INSTALL file. Both programs should compile
40cleanly with:
41./configure
42make
43make install  <-- (Need root to install in system directories)
44
45If you do not use CodeWarrior, and are not compiling for the command line,
46you are on your own; however these programs should compile easily under any
47environment. You may need to include the following:
48
49#define  __dest_os	  __mac_os
50
51Do NOT include that when compiling for the command line under OS X.
52
53
54Have fun.
55