Generated file

Copy as Markdown

Other Tools

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_net_happy_eyeballs_glue_h
#define mozilla_net_happy_eyeballs_glue_h
/* Generated with cbindgen:0.29.1 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
*/
namespace mozilla { namespace net { class HappyEyeballs; union NetAddr; } }
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
#include "nsError.h"
#include "nsString.h"
#include "nsTArray.h"
namespace mozilla {
namespace net {
namespace happy_eyeballs {
enum class HttpVersion {
H3 = 0,
H2 = 1,
H1 = 2,
};
enum class IpPreference {
DualStackPreferV6 = 0,
DualStackPreferV4 = 1,
};
enum class DnsRecordType {
Https = 0,
Aaaa = 1,
A = 2,
};
enum class ConnectionAttemptHttpVersions {
H3 = 0,
H2OrH1 = 1,
H2 = 2,
H1 = 3,
};
struct AltSvc {
HttpVersion http_version;
};
struct ServiceInfo {
uint16_t priority;
uint16_t port;
nsCString target_name;
nsTArray<HttpVersion> alpn_http_versions;
nsTArray<uint8_t> ech_config;
nsTArray<NetAddr> ipv4_hints;
nsTArray<NetAddr> ipv6_hints;
};
struct IpAddr {
enum class Tag {
V4,
V6,
};
struct V4_Body {
uint8_t _0[4];
};
struct V6_Body {
uint8_t _0[16];
};
Tag tag;
union {
V4_Body v4;
V6_Body v6;
};
};
struct Output {
enum class Tag {
SendDnsQuery,
Timer,
AttemptConnection,
CancelConnection,
Succeeded,
Failed,
None,
};
struct SendDnsQuery_Body {
uint64_t id;
DnsRecordType record_type;
};
struct Timer_Body {
uint64_t duration_ms;
};
struct AttemptConnection_Body {
uint64_t id;
ConnectionAttemptHttpVersions http_version;
IpAddr addr;
uint16_t port;
};
struct CancelConnection_Body {
uint64_t id;
};
Tag tag;
union {
SendDnsQuery_Body send_dns_query;
Timer_Body timer;
AttemptConnection_Body attempt_connection;
CancelConnection_Body cancel_connection;
};
};
extern "C" {
nsresult create(const HappyEyeballs **result,
const nsACString *origin,
uint16_t port,
const nsTArray<AltSvc> *alt_svc,
IpPreference ip_preference);
nsresult process_dns_response_a(HappyEyeballs *he, uint64_t id, const nsTArray<NetAddr> *addrs);
nsresult process_dns_response_aaaa(HappyEyeballs *he, uint64_t id, const nsTArray<NetAddr> *addrs);
nsresult process_dns_response_https(HappyEyeballs *he,
uint64_t id,
const nsTArray<ServiceInfo> *service_infos);
nsresult process_connection_result(HappyEyeballs *he, uint64_t id, nsresult status);
nsresult process_output(HappyEyeballs *he, Output *ret_event, nsTArray<uint8_t> *ech_config);
void release(const HappyEyeballs *happy_eyeballs);
void addref(const HappyEyeballs *happy_eyeballs);
extern uint16_t moz_netaddr_get_family(const NetAddr *arg);
extern uint32_t moz_netaddr_get_network_order_ip(const NetAddr *arg);
extern const uint8_t *moz_netaddr_get_ipv6(const NetAddr *arg);
} // extern "C"
} // namespace happy_eyeballs
} // namespace net
} // namespace mozilla
#endif // mozilla_net_happy_eyeballs_glue_h