1 /* Copyright © 2012 Brandon L Black <blblack@gmail.com> 2 * 3 * This file is part of gdnsd. 4 * 5 * gdnsd-plugin-geoip is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * gdnsd-plugin-geoip is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with gdnsd. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 #ifndef GDGEOIP_H 21 #define GDGEOIP_H 22 23 #include "fips104.h" 24 #include "dclists.h" 25 #include "dcmap.h" 26 #include "nlist.h" 27 28 #include <gdnsd/compiler.h> 29 #include <gdnsd/log.h> 30 31 F_NONNULL 32 void validate_country_code(const char* cc, const char* map_name); 33 F_NONNULL 34 void validate_continent_code(const char* cc, const char* map_name); 35 36 typedef enum { 37 V4O_NONE = 0, // no v4_overlay in effect 38 V4O_PRIMARY, // v4_overlay in effect, and this is the primary (must be IPv6, skip IPv4 area) 39 V4O_SECONDARY, // v4_overlay in effect, and this is the secondary (must be IPv4) 40 } gdgeoip_v4o_t; 41 42 F_NONNULLX(1,2,3) 43 nlist_t* gdgeoip_make_list(const char* pathname, const char* map_name, dclists_t* dclists, const dcmap_t* dcmap, const fips_t* fips, const gdgeoip_v4o_t v4o_flag, const bool city_auto_mode, const bool city_no_city); 44 45 #endif // GDGEOIP_H 46