telize

High performance JSON IP and GeoIP REST API (IP Geolocation)
Log | Files | Refs | README | LICENSE

telize.h (943B)


      1 /*
      2  * Telize 3.1.0
      3  * Copyright (c) 2013-2021, Frederic Cambus
      4  * https://www.telize.com
      5  *
      6  * Created:      2013-08-15
      7  * Last Updated: 2021-03-29
      8  *
      9  * Telize is released under the BSD 2-Clause license.
     10  * See LICENSE file for details.
     11  *
     12  * SPDX-License-Identifier: BSD-2-Clause
     13  */
     14 
     15 #ifndef TELIZE_H
     16 #define TELIZE_H
     17 
     18 #include <kore/kore.h>
     19 #include <kore/http.h>
     20 
     21 #include <maxminddb.h>
     22 
     23 #define ENTRY_TYPE_UINT32	0
     24 #define ENTRY_TYPE_STRING	1
     25 #define ENTRY_TYPE_DOUBLE	2
     26 #define ENTRY_TYPE_BOOLEAN	3
     27 
     28 int	request_ip(struct http_request *);
     29 int	request_json_ip(struct http_request *);
     30 int	request_location(struct http_request *);
     31 
     32 int	telize_init(int);
     33 int	telize_request_ip(struct http_request *, char *, size_t);
     34 void	telize_getdata(struct kore_buf *, MMDB_lookup_result_s *,
     35 	    MMDB_entry_data_s *, char *, int, ...);
     36 
     37 int	location(struct http_request *);
     38 
     39 extern MMDB_s telize_asn;
     40 extern MMDB_s telize_city;
     41 
     42 #endif /* TELIZE_H */