poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
ipaddr.h
Go to the documentation of this file.
1#ifndef POSER_CORE_IPADDR_H
2#define POSER_CORE_IPADDR_H
3
8#include <poser/decl.h>
9#include <poser/core/proto.h>
10
17C_CLASS_DECL(PSC_IpAddr);
18
26DECLEXPORT PSC_IpAddr *
27PSC_IpAddr_create(const char *str)
28 ATTR_NONNULL((1));
29
36DECLEXPORT PSC_IpAddr *
38 CMETHOD ATTR_RETNONNULL;
39
55DECLEXPORT PSC_IpAddr *
56PSC_IpAddr_tov4(const PSC_IpAddr *self, const PSC_IpAddr **prefixes)
57 CMETHOD ATTR_NONNULL((2));
58
72DECLEXPORT PSC_IpAddr *
73PSC_IpAddr_tov6(const PSC_IpAddr *self, const PSC_IpAddr *prefix)
74 CMETHOD ATTR_NONNULL((1));
75
81DECLEXPORT PSC_Proto
83 CMETHOD ATTR_PURE;
84
90DECLEXPORT unsigned
92 CMETHOD ATTR_PURE;
93
102DECLEXPORT const char *
104 CMETHOD ATTR_RETNONNULL ATTR_PURE;
105
113DECLEXPORT int
114PSC_IpAddr_equals(const PSC_IpAddr *self, const PSC_IpAddr *other)
115 CMETHOD ATTR_NONNULL((2)) ATTR_PURE;
116
125DECLEXPORT int
126PSC_IpAddr_matches(const PSC_IpAddr *self, const PSC_IpAddr *prefix)
127 CMETHOD ATTR_NONNULL((2)) ATTR_PURE;
128
133DECLEXPORT void
134PSC_IpAddr_destroy(PSC_IpAddr *self);
135
136#endif
An IPv4 or IPv6 address or network.
PSC_IpAddr * PSC_IpAddr_tov4(const PSC_IpAddr *self, const PSC_IpAddr **prefixes)
Create IPv4 equivalent of a given IPv6 address.
PSC_Proto PSC_IpAddr_proto(const PSC_IpAddr *self)
The protocol of the address.
PSC_IpAddr * PSC_IpAddr_create(const char *str)
PSC_IpAddr default constructor.
int PSC_IpAddr_equals(const PSC_IpAddr *self, const PSC_IpAddr *other)
Compare two addresses for equality.
PSC_IpAddr * PSC_IpAddr_tov6(const PSC_IpAddr *self, const PSC_IpAddr *prefix)
Create IPv6 equivalent of a given IPv4 address.
PSC_IpAddr * PSC_IpAddr_clone(const PSC_IpAddr *other)
PSC_IpAddr copy constructor.
unsigned PSC_IpAddr_prefixlen(const PSC_IpAddr *self)
The prefix length of the address.
const char * PSC_IpAddr_string(const PSC_IpAddr *self)
The canonical string representation of the address.
declaration of the PSC_Proto enum
PSC_Proto
Protocol to use for TCP connections.
Definition: proto.h:10