acme_dns_client.h File Reference

ACME-DNS client. More...

#include "acme_config.h"
#include "core/net.h"
#include "http/http_client.h"
#include "core/crypto.h"
#include "tls.h"

Go to the source code of this file.

Data Structures

struct  _AcmeDnsClientContext
 ACME-DNS client context. More...
 

Macros

#define ACME_DNS_CLIENT_SUPPORT   ENABLED
 
#define ACME_DNS_CLIENT_TLS_SUPPORT   DISABLED
 
#define ACME_DNS_CLIENT_DEFAULT_TIMEOUT   20000
 
#define ACME_DNS_CLIENT_BUFFER_SIZE   512
 
#define ACME_DNS_CLIENT_MAX_HOST_LEN   64
 
#define ACME_DNS_CLIENT_MAX_USERNAME_LEN   64
 
#define ACME_DNS_CLIENT_MAX_PASSWORD_LEN   64
 
#define ACME_DNS_CLIENT_MAX_SUB_DOMAIN_LEN   64
 
#define ACME_DNS_CLIENT_MAX_FULL_DOMAIN_LEN   128
 
#define ACME_DNS_TXT_RECORD_LEN   43
 
#define AcmeDnsClientContext   struct _AcmeDnsClientContext
 

Typedefs

typedef error_t(* AcmeDnsClientTlsInitCallback) (HttpClientContext *context, TlsContext *tlsContext)
 TLS initialization callback function. More...
 

Enumerations

enum  AcmeDnsClientState {
  ACME_DNS_CLIENT_STATE_DISCONNECTED = 0, ACME_DNS_CLIENT_STATE_CONNECTING = 1, ACME_DNS_CLIENT_STATE_CONNECTED = 2, ACME_DNS_CLIENT_STATE_SEND_HEADER = 3,
  ACME_DNS_CLIENT_STATE_SEND_BODY = 4, ACME_DNS_CLIENT_STATE_RECEIVE_HEADER = 5, ACME_DNS_CLIENT_STATE_PARSE_HEADER = 6, ACME_DNS_CLIENT_STATE_RECEIVE_BODY = 7,
  ACME_DNS_CLIENT_STATE_PARSE_BODY = 8, ACME_DNS_CLIENT_STATE_CLOSE_BODY = 9, ACME_DNS_CLIENT_STATE_DISCONNECTING = 10
}
 ACME-DNS client states. More...
 

Functions

error_t acmeDnsClientInit (AcmeDnsClientContext *context)
 Initialize ACME-DNS client context. More...
 
error_t acmeDnsClientRegisterTlsInitCallback (AcmeDnsClientContext *context, AcmeDnsClientTlsInitCallback callback)
 Register TLS initialization callback function. More...
 
error_t acmeDnsClientSetTimeout (AcmeDnsClientContext *context, systime_t timeout)
 Set communication timeout. More...
 
error_t acmeDnsClientSetHost (AcmeDnsClientContext *context, const char_t *host)
 Set the domain name of the ACME-DNS server. More...
 
error_t acmeDnsClientSetUsername (AcmeDnsClientContext *context, const char_t *username)
 Set user name. More...
 
error_t acmeDnsClientSetPassword (AcmeDnsClientContext *context, const char_t *password)
 Set password. More...
 
error_t acmeDnsClientSetSubDomain (AcmeDnsClientContext *context, const char_t *subDomain)
 Set sub domain. More...
 
const char_tacmeDnsClientGetUsername (AcmeDnsClientContext *context)
 Get user name. More...
 
const char_tacmeDnsClientGetPassword (AcmeDnsClientContext *context)
 Get password. More...
 
const char_tacmeDnsClientGetSubDomain (AcmeDnsClientContext *context)
 Get sub domain. More...
 
const char_tacmeDnsClientGetFullDomain (AcmeDnsClientContext *context)
 Get full domain. More...
 
error_t acmeDnsClientBindToInterface (AcmeDnsClientContext *context, NetInterface *interface)
 Bind the ACME-DNS client to a particular network interface. More...
 
error_t acmeDnsClientConnect (AcmeDnsClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort)
 Establish a connection with the specified ACME-DNS server. More...
 
error_t acmeDnsClientRegister (AcmeDnsClientContext *context)
 Register endpoint. More...
 
error_t acmeDnsClientUpdate (AcmeDnsClientContext *context, const char_t *txt)
 Update endpoint. More...
 
error_t acmeDnsClientDisconnect (AcmeDnsClientContext *context)
 Gracefully disconnect from the ACME-DNS server. More...
 
error_t acmeDnsClientClose (AcmeDnsClientContext *context)
 Close the connection with the ACME-DNS server. More...
 
void acmeDnsClientDeinit (AcmeDnsClientContext *context)
 Release ACME-DNS client context. More...
 

Detailed Description

ACME-DNS client.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneACME Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file acme_dns_client.h.

Macro Definition Documentation

◆ ACME_DNS_CLIENT_BUFFER_SIZE

#define ACME_DNS_CLIENT_BUFFER_SIZE   512

Definition at line 62 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_DEFAULT_TIMEOUT

#define ACME_DNS_CLIENT_DEFAULT_TIMEOUT   20000

Definition at line 55 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_MAX_FULL_DOMAIN_LEN

#define ACME_DNS_CLIENT_MAX_FULL_DOMAIN_LEN   128

Definition at line 97 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_MAX_HOST_LEN

#define ACME_DNS_CLIENT_MAX_HOST_LEN   64

Definition at line 69 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_MAX_PASSWORD_LEN

#define ACME_DNS_CLIENT_MAX_PASSWORD_LEN   64

Definition at line 83 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_MAX_SUB_DOMAIN_LEN

#define ACME_DNS_CLIENT_MAX_SUB_DOMAIN_LEN   64

Definition at line 90 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_MAX_USERNAME_LEN

#define ACME_DNS_CLIENT_MAX_USERNAME_LEN   64

Definition at line 76 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_SUPPORT

#define ACME_DNS_CLIENT_SUPPORT   ENABLED

Definition at line 41 of file acme_dns_client.h.

◆ ACME_DNS_CLIENT_TLS_SUPPORT

#define ACME_DNS_CLIENT_TLS_SUPPORT   DISABLED

Definition at line 48 of file acme_dns_client.h.

◆ ACME_DNS_TXT_RECORD_LEN

#define ACME_DNS_TXT_RECORD_LEN   43

Definition at line 103 of file acme_dns_client.h.

◆ AcmeDnsClientContext

#define AcmeDnsClientContext   struct _AcmeDnsClientContext

Definition at line 113 of file acme_dns_client.h.

Typedef Documentation

◆ AcmeDnsClientTlsInitCallback

typedef error_t(* AcmeDnsClientTlsInitCallback) (HttpClientContext *context, TlsContext *tlsContext)

TLS initialization callback function.

Definition at line 148 of file acme_dns_client.h.

Enumeration Type Documentation

◆ AcmeDnsClientState

ACME-DNS client states.

Enumerator
ACME_DNS_CLIENT_STATE_DISCONNECTED 
ACME_DNS_CLIENT_STATE_CONNECTING 
ACME_DNS_CLIENT_STATE_CONNECTED 
ACME_DNS_CLIENT_STATE_SEND_HEADER 
ACME_DNS_CLIENT_STATE_SEND_BODY 
ACME_DNS_CLIENT_STATE_RECEIVE_HEADER 
ACME_DNS_CLIENT_STATE_PARSE_HEADER 
ACME_DNS_CLIENT_STATE_RECEIVE_BODY 
ACME_DNS_CLIENT_STATE_PARSE_BODY 
ACME_DNS_CLIENT_STATE_CLOSE_BODY 
ACME_DNS_CLIENT_STATE_DISCONNECTING 

Definition at line 125 of file acme_dns_client.h.

Function Documentation

◆ acmeDnsClientBindToInterface()

error_t acmeDnsClientBindToInterface ( AcmeDnsClientContext context,
NetInterface interface 
)

Bind the ACME-DNS client to a particular network interface.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]interfaceNetwork interface to be used
Returns
Error code

Definition at line 335 of file acme_dns_client.c.

◆ acmeDnsClientClose()

error_t acmeDnsClientClose ( AcmeDnsClientContext context)

Close the connection with the ACME-DNS server.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
Error code

Definition at line 839 of file acme_dns_client.c.

◆ acmeDnsClientConnect()

error_t acmeDnsClientConnect ( AcmeDnsClientContext context,
const IpAddr serverIpAddr,
uint16_t  serverPort 
)

Establish a connection with the specified ACME-DNS server.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]serverIpAddrIP address of the ACME-DNS server to connect to
[in]serverPortPort number
Returns
Error code

Definition at line 358 of file acme_dns_client.c.

◆ acmeDnsClientDeinit()

void acmeDnsClientDeinit ( AcmeDnsClientContext context)

Release ACME-DNS client context.

Parameters
[in]contextPointer to the ACME-DNS client context

Definition at line 860 of file acme_dns_client.c.

◆ acmeDnsClientDisconnect()

error_t acmeDnsClientDisconnect ( AcmeDnsClientContext context)

Gracefully disconnect from the ACME-DNS server.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
Error code

Definition at line 773 of file acme_dns_client.c.

◆ acmeDnsClientGetFullDomain()

const char_t* acmeDnsClientGetFullDomain ( AcmeDnsClientContext context)

Get full domain.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
NULL-terminated string containing the full domain

Definition at line 309 of file acme_dns_client.c.

◆ acmeDnsClientGetPassword()

const char_t* acmeDnsClientGetPassword ( AcmeDnsClientContext context)

Get password.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
NULL-terminated string containing the password

Definition at line 259 of file acme_dns_client.c.

◆ acmeDnsClientGetSubDomain()

const char_t* acmeDnsClientGetSubDomain ( AcmeDnsClientContext context)

Get sub domain.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
NULL-terminated string containing the sub domain

Definition at line 284 of file acme_dns_client.c.

◆ acmeDnsClientGetUsername()

const char_t* acmeDnsClientGetUsername ( AcmeDnsClientContext context)

Get user name.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
NULL-terminated string containing the user name

Definition at line 234 of file acme_dns_client.c.

◆ acmeDnsClientInit()

error_t acmeDnsClientInit ( AcmeDnsClientContext context)

Initialize ACME-DNS client context.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
Error code

Definition at line 49 of file acme_dns_client.c.

◆ acmeDnsClientRegister()

error_t acmeDnsClientRegister ( AcmeDnsClientContext context)

Register endpoint.

Parameters
[in]contextPointer to the ACME-DNS client context
Returns
Error code

Definition at line 460 of file acme_dns_client.c.

◆ acmeDnsClientRegisterTlsInitCallback()

error_t acmeDnsClientRegisterTlsInitCallback ( AcmeDnsClientContext context,
AcmeDnsClientTlsInitCallback  callback 
)

Register TLS initialization callback function.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]callbackTLS initialization callback function
Returns
Error code

Definition at line 85 of file acme_dns_client.c.

◆ acmeDnsClientSetHost()

error_t acmeDnsClientSetHost ( AcmeDnsClientContext context,
const char_t host 
)

Set the domain name of the ACME-DNS server.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]hostNULL-terminated string containing the host name
Returns
Error code

Definition at line 131 of file acme_dns_client.c.

◆ acmeDnsClientSetPassword()

error_t acmeDnsClientSetPassword ( AcmeDnsClientContext context,
const char_t password 
)

Set password.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]passwordNULL-terminated string containing the password
Returns
Error code

Definition at line 183 of file acme_dns_client.c.

◆ acmeDnsClientSetSubDomain()

error_t acmeDnsClientSetSubDomain ( AcmeDnsClientContext context,
const char_t subDomain 
)

Set sub domain.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]subDomainNULL-terminated string containing the sub domain
Returns
Error code

Definition at line 209 of file acme_dns_client.c.

◆ acmeDnsClientSetTimeout()

error_t acmeDnsClientSetTimeout ( AcmeDnsClientContext context,
systime_t  timeout 
)

Set communication timeout.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]timeoutTimeout value, in milliseconds
Returns
Error code

Definition at line 109 of file acme_dns_client.c.

◆ acmeDnsClientSetUsername()

error_t acmeDnsClientSetUsername ( AcmeDnsClientContext context,
const char_t username 
)

Set user name.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]usernameNULL-terminated string containing the user name
Returns
Error code

Definition at line 157 of file acme_dns_client.c.

◆ acmeDnsClientUpdate()

error_t acmeDnsClientUpdate ( AcmeDnsClientContext context,
const char_t txt 
)

Update endpoint.

Parameters
[in]contextPointer to the ACME-DNS client context
[in]txtNULL-terminated string that contains the value of the TXT record
Returns
Error code

Definition at line 602 of file acme_dns_client.c.