receivedipdbusort(1)

NAME

receivedIPdbusort - sort the IP addresses in a database
file

SYNOPSIS

receivedIPdbusort [-v] dbfilename

DESCRIPTION

ReceivedIPdbusort is for sorting a database of IP address
es-each IP address in the output will be unique.
The program requires mmap(2) to map the database file of
IP addresses into the Unix VM system. The database file name is a
required command line argument.
The database is a standard Unix text file, one IP address
per line, in lexical order, constructed with "sort -u infile >
outfile", or equivalent. An IP address range can be represented
as a Class A, B, or C range. For example, the IP address
"123.210." in the database file would match "123.210.1.0".
The most common usage is where the input database, exam
ple.db, is a list of IP addresses, and the output file is a
uniquely sorted list of IP addresses, out.db.

receivedIPdbusort example.db > out.db.
The sort mechanism is implemented as a quicksort.
The program, also, eliminates duplicate records, (i.e.,
records that are lexically equal,) and removes leading and trail
ing white space in each record.
The program contains less than 300 lines of declarations
and statements, all of which are documented with in line com
ments.
The program has been compiled and tested on SunOS, So
laris, and Linux, and may work on other brands of Unix.
The program returns 0 if no error; else returns a unique
error code greater than 1 representing the error encountered
which will, also, print an error diagnostic to stderr.

OPTIONS

dbfilename
Database file name of IP addresses.
-v Print the program's version information.

WARNINGS

Under buffer overflow conditions, the program makes no at
tempts at handling the situation-it just detects it, prints an
error message, and exits.
The program is capable of rejecting entire Class A, Class
B, or Class C, IP address ranges. Discretion is advised.

SEE ALSO

receivedIP(1), receivedIPdb(1), receivedIPdbdedup(1), re
ceivedIPdbrm(1), receivedIPdbusort(1), bsearchtext(1), re
ceivedAddress(1), receivedTodb(1), receivedMSGIDdb(1), receive
dUnknowndb(1), tolower(1), toupper(1), bsorttext(1) receivedIP
forgedb(1), hsearchtext(1), bsearchbody(1)

DIAGNOSTICS

Error messages for incompatible arguments, failure to al
locate memory, inaccessible files, opening and closing files.

AUTHORS

---------------------------------------------------------------------

A license is hereby granted to reproduce this software
source code and
to create executable versions from this source code for
personal,
non-commercial use. The copyright notice included with
the software
must be maintained in all copies produced.
THIS PROGRAM IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO
WARRANTIES
WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF
MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PUR
POSE. THE
AUTHOR DOES NOT WARRANT THAT USE OF THIS PROGRAM DOES NOT
INFRINGE THE
INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY
COUNTRY.
Copyright (c) 2001-2007, John Conover, All Rights Re
served.
Comments and/or bug reports should be addressed to:

john@email.johncon.com (John Conover)
---------------------------------------------------------------------

January 16, 2007 RE
Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout