@@ -337,6 +337,36 @@ static PyObject * GeoIP_populate_dict(GeoIP* gi, GeoIPRecord *gir) {
337
337
return retval ;
338
338
}
339
339
340
+ static PyObject * GeoIP_record_by_addr_v6_Py (PyObject * self , PyObject * args ) {
341
+ char * addr ;
342
+ GeoIPRecord * gir ;
343
+ GeoIP_GeoIPObject * GeoIP = (GeoIP_GeoIPObject * )self ;
344
+ if (!PyArg_ParseTuple (args , "s" , & addr )) {
345
+ return NULL ;
346
+ }
347
+ gir = GeoIP_record_by_addr_v6 (GeoIP -> gi , addr );
348
+ if (gir == NULL ) {
349
+ Py_INCREF (Py_None );
350
+ return Py_None ;
351
+ }
352
+ return GeoIP_populate_dict (GeoIP -> gi , gir );
353
+ }
354
+
355
+ static PyObject * GeoIP_record_by_name_v6_Py (PyObject * self , PyObject * args ) {
356
+ char * name ;
357
+ GeoIPRecord * gir ;
358
+ GeoIP_GeoIPObject * GeoIP = (GeoIP_GeoIPObject * )self ;
359
+ if (!PyArg_ParseTuple (args , "s" , & name )) {
360
+ return NULL ;
361
+ }
362
+ gir = GeoIP_record_by_name_v6 (GeoIP -> gi , name );
363
+ if (gir == NULL ) {
364
+ Py_INCREF (Py_None );
365
+ return Py_None ;
366
+ }
367
+ return GeoIP_populate_dict (GeoIP -> gi , gir );
368
+ }
369
+
340
370
static PyObject * GeoIP_record_by_addr_Py (PyObject * self , PyObject * args ) {
341
371
char * addr ;
342
372
GeoIPRecord * gir ;
@@ -465,8 +495,6 @@ static PyObject * GeoIP_time_zone_by_country_and_region_Py(PyObject *self, PyObj
465
495
return Py_BuildValue ("s" , GeoIP_time_zone_by_country_and_region (country_code , region ));
466
496
}
467
497
468
-
469
-
470
498
static PyMethodDef GeoIP_Object_methods [] = {
471
499
{"country_code_by_name" , GeoIP_country_code_by_name_Py , 1 , "Lookup Country Code By Name" },
472
500
{"country_name_by_name" , GeoIP_country_name_by_name_Py , 1 , "Lookup Country Name By Name" },
@@ -490,6 +518,8 @@ static PyMethodDef GeoIP_Object_methods[] = {
490
518
{"teredo" , GeoIP_teredo_Py , 1 , "Returns true if teredo is enabled" },
491
519
{"id_by_addr" , GeoIP_id_by_addr_Py , 1 , "Lookup Netspeed By IP Address" },
492
520
{"id_by_name" , GeoIP_id_by_name_Py , 1 , "Lookup Netspeed By Name" },
521
+ {"record_by_addr_v6" , GeoIP_record_by_addr_v6_Py , 1 , "Lookup City Region By IP Address" },
522
+ {"record_by_name_v6" , GeoIP_record_by_name_v6_Py , 1 , "Lookup City Region By Name" },
493
523
{NULL , NULL , 0 , NULL }
494
524
};
495
525
0 commit comments