Source

hproxy / lib.h

Full commit
#ifndef _LIB_H
#define _LIB_H

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

#ifndef _LIB_H_NOEXTERN
#   define _LIB_H_NOEXTERN extern
#endif

typedef struct
{
    int lsock;
    int psock;

    char hostname[256];
    int  port;
} hproxy_state_t;

typedef int (*connect_t)(int socket, const struct sockaddr *address, socklen_t address_len);
typedef struct hostent *  (*gethostbyname_t) (const char *name);
typedef int (*getaddrinfo_t)(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);

_LIB_H_NOEXTERN connect_t       true_connect;
_LIB_H_NOEXTERN gethostbyname_t true_gethostbyname;
_LIB_H_NOEXTERN getaddrinfo_t   true_getaddrinfo;

#endif