Classes | Macros | Functions | Variables
acountry.c File Reference
#include "ares_setup.h"
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include "ares.h"
#include "ares_getopt.h"
#include "ares_nowarn.h"
#include "ares_strdup.h"
#include "ares_strcasecmp.h"
Include dependency graph for acountry.c:

Go to the source code of this file.

Classes

struct  search_list
 

Macros

#define BYTE_OK(x)   ((x) >= 0 && (x) <= 255)
 
#define CARES_INADDR_CAST(type, var)   ((type)((void *)var))
 
#define INADDR_NONE   0xffffffff
 
#define strcasecmp(p1, p2)   ares_strcasecmp(p1,p2)
 
#define strdup(ptr)   ares_strdup(ptr)
 
#define strncasecmp(p1, p2, n)   ares_strncasecmp(p1,p2,n)
 
#define TRACE(fmt)
 

Functions

static void Abort (const char *fmt,...)
 
static void callback (void *arg, int status, int timeouts, struct hostent *host)
 
static void callback2 (void *arg, int status, int timeouts, struct hostent *host)
 
static void find_country_from_cname (const char *cname, struct in_addr addr)
 
static int is_addr (char *str, char **end)
 
static const struct search_listlist_lookup (int number, const struct search_list *list, int num)
 
int main (int argc, char **argv)
 
static void print_help_info_acountry (void)
 
static void wait_ares (ares_channel channel)
 

Variables

static const struct search_list country_list []
 
static const char nerd_fmt [] = "%u.%u.%u.%u.zz.countries.nerd.dk"
 
static const char * nerd_ver1 = nerd_fmt + 14
 
static const char * nerd_ver2 = nerd_fmt + 11
 
static const char * usage = "acountry [-?hdv] {host|addr} ...\n"
 
static int verbose = 0
 

Macro Definition Documentation

◆ BYTE_OK

#define BYTE_OK (   x)    ((x) >= 0 && (x) <= 255)

Definition at line 542 of file acountry.c.

◆ CARES_INADDR_CAST

#define CARES_INADDR_CAST (   type,
  var 
)    ((type)((void *)var))

Definition at line 75 of file acountry.c.

◆ INADDR_NONE

#define INADDR_NONE   0xffffffff

Definition at line 69 of file acountry.c.

◆ strcasecmp

#define strcasecmp (   p1,
  p2 
)    ares_strcasecmp(p1,p2)

Definition at line 60 of file acountry.c.

◆ strdup

#define strdup (   ptr)    ares_strdup(ptr)

Definition at line 55 of file acountry.c.

◆ strncasecmp

#define strncasecmp (   p1,
  p2,
  n 
)    ares_strncasecmp(p1,p2,n)

Definition at line 65 of file acountry.c.

◆ TRACE

#define TRACE (   fmt)
Value:
do { \
if (verbose > 0) \
printf fmt ; \

Definition at line 83 of file acountry.c.

Function Documentation

◆ Abort()

static void Abort ( const char *  fmt,
  ... 
)
static

Definition at line 94 of file acountry.c.

◆ callback()

static void callback ( void *  arg,
int  status,
int  timeouts,
struct hostent *  host 
)
static

Definition at line 224 of file acountry.c.

◆ callback2()

static void callback2 ( void *  arg,
int  status,
int  timeouts,
struct hostent *  host 
)
static

Definition at line 252 of file acountry.c.

◆ find_country_from_cname()

static void find_country_from_cname ( const char *  cname,
struct in_addr  addr 
)
static

Definition at line 566 of file acountry.c.

◆ is_addr()

static int is_addr ( char *  str,
char **  end 
)
static

Definition at line 544 of file acountry.c.

◆ list_lookup()

static const struct search_list* list_lookup ( int  number,
const struct search_list list,
int  num 
)
static

Definition at line 269 of file acountry.c.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 103 of file acountry.c.

◆ print_help_info_acountry()

static void print_help_info_acountry ( void  )
static

Definition at line 645 of file acountry.c.

◆ wait_ares()

static void wait_ares ( ares_channel  channel)
static

Definition at line 199 of file acountry.c.

Variable Documentation

◆ country_list

const struct search_list country_list[]
static

Definition at line 284 of file acountry.c.

◆ nerd_fmt

const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk"
static

Definition at line 78 of file acountry.c.

◆ nerd_ver1

const char* nerd_ver1 = nerd_fmt + 14
static

Definition at line 79 of file acountry.c.

◆ nerd_ver2

const char* nerd_ver2 = nerd_fmt + 11
static

Definition at line 80 of file acountry.c.

◆ usage

const char* usage = "acountry [-?hdv] {host|addr} ...\n"
static

Definition at line 77 of file acountry.c.

◆ verbose

int verbose = 0
static

Definition at line 81 of file acountry.c.

verbose
static int verbose
Definition: acountry.c:81
testing::internal::fmt
GTEST_API_ const char * fmt
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1808
WHILE_FALSE
#define WHILE_FALSE
Definition: setup_once.h:349


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:02