Create MaxMind DB database files
Perl C++ C XS Shell
Latest commit 952abfc Nov 10, 2017 @horgh horgh Bump version after release
Permalink
Failed to load latest commit information.
bench
c
dev-bin Throw an exception if an alias node is overwritten Jul 12, 2016
eg
inc Don't look in Build.PL or inc/ for prereqs Nov 30, 2016
lib/MaxMind/DB
t Silently ignore inserts to reserved networks Oct 24, 2017
xt/author Tidy all code and fix critic errors Nov 29, 2016
.gitignore
.mailmap
.perltidyallrc Add tidy config. Jun 27, 2014
.tidyallrc
.travis.yml Throw an exception if an alias node is overwritten Jul 12, 2016
.uncrustify.cfg Teach uncrustify about our types so it doesn't add spaces where they'… May 15, 2014
Build.PL Bump version after release Nov 10, 2017
CONTRIBUTING.md
Changes v0.300000 Nov 10, 2017
LICENSE v0.300000 Nov 10, 2017
README.md
cpanfile v0.202000 Dec 19, 2016
dist.ini
perlcriticrc
perltidyrc Add tidyall-related files Mar 11, 2015
tidyall.ini
valgrind.supp Add some more Perl core suppressions Feb 10, 2014

README.md

NAME

MaxMind::DB::Writer - Create MaxMind DB database files

VERSION

version 0.300000

SYNOPSIS

use MaxMind::DB::Writer::Tree;

my %types = (
    color => 'utf8_string',
    dogs  => [ 'array', 'utf8_string' ],
    size  => 'uint16',
);

my $tree = MaxMind::DB::Writer::Tree->new(
    ip_version            => 6,
    record_size           => 24,
    database_type         => 'My-IP-Data',
    languages             => ['en'],
    description           => { en => 'My database of IP data' },
    map_key_type_callback => sub { $types{ $_[0] } },
);

$tree->insert_network(
    '8.8.8.0/24',
    {
        color => 'blue',
        dogs  => [ 'Fido', 'Ms. Pretty Paws' ],
        size  => 42,
    },
);

open my $fh, '>:raw', '/path/to/my-ip-data.mmdb';
$tree->write_tree($fh);

DESCRIPTION

This distribution contains the code necessary to write MaxMind DB database files. See MaxMind::DB::Writer::Tree for API docs.

MAC OS X SUPPORT

If you're running into install errors under Mac OS X, you may need to force a build of the 64 bit binary. For example, if you're installing via cpanm:

ARCHFLAGS="-arch x86_64" cpanm MaxMind::DB::Writer

WINDOWS SUPPORT

This distribution does not currently work on Windows. Reasonable patches for Windows support are very welcome. You will probably need to start by making Math::Int128 work on Windows, since we use that module's C API for dealing with 128-bit integers to represent IPv6 addresses numerically.

SUPPORT

Please report all issues with this code using the GitHub issue tracker at https://github.com/maxmind/MaxMind-DB-Writer-perl/issues.

We welcome patches as pull requests against our GitHub repository at https://github.com/maxmind/MaxMind-DB-Writer-perl.

Bugs may be submitted through https://github.com/maxmind/MaxMind-DB-Writer-perl/issues.

AUTHORS

CONTRIBUTORS

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by MaxMind, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.