Tor 0.4.9.0-alpha-dev
inaddr.h
Go to the documentation of this file.
1/* Copyright (c) 2003-2004, Roger Dingledine
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2021, The Tor Project, Inc. */
4/* See LICENSE for licensing information */
5
6/**
7 * \file inaddr.h
8 * \brief Header for inaddr.c.
9 **/
10
11#ifndef TOR_INADDR_H
12#define TOR_INADDR_H
13
14#include "orconfig.h"
15#include <stddef.h>
16
17struct in_addr;
18
19int tor_inet_aton(const char *str, struct in_addr *addr);
20/** Length of a buffer to allocate to hold the results of tor_inet_ntoa.*/
21#define INET_NTOA_BUF_LEN 16
22int tor_inet_ntoa(const struct in_addr *in, char *buf, size_t buf_len);
23
24const char *tor_inet_ntop(int af, const void *src, char *dst, size_t len);
25int tor_inet_pton(int af, const char *src, void *dst);
26
27#endif /* !defined(TOR_INADDR_H) */
int tor_inet_ntoa(const struct in_addr *in, char *buf, size_t buf_len)
Definition: inaddr.c:79
int tor_inet_aton(const char *str, struct in_addr *addr)
Definition: inaddr.c:40
int tor_inet_pton(int af, const char *src, void *dst)
Definition: inaddr.c:187
const char * tor_inet_ntop(int af, const void *src, char *dst, size_t len)
Definition: inaddr.c:98