telize

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

telize.h (870B)


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