summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/arpa/inet.h
blob: 3ba673731f7529dec2167073c3b987e3ae5dbf71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <inttypes.h>
#include <netinet/in.h>
#include <sys/cdefs.h>
#include <sys/socket.h>

__BEGIN_DECLS

#define INET_ADDRSTRLEN 16
#define INET6_ADDRSTRLEN 46

const char* inet_ntop(int af, const void* src, char* dst, socklen_t);
int inet_pton(int af, const char* src, void* dst);

static inline int inet_aton(const char* cp, struct in_addr* inp)
{
    return inet_pton(AF_INET, cp, inp);
}

char* inet_ntoa(struct in_addr);

__END_DECLS