Tor  0.4.7.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 
17 struct in_addr;
18 
19 int 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
22 int tor_inet_ntoa(const struct in_addr *in, char *buf, size_t buf_len);
23 
24 const char *tor_inet_ntop(int af, const void *src, char *dst, size_t len);
25 int 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