-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnsupdate.h
46 lines (38 loc) · 1.79 KB
/
dnsupdate.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* dnsupdate.h -- Write DNS UPDATE + SIG(0) message
*
* Copyright Dean Scarff
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License.
*/
#ifndef DNSUPDATE_H
#define DNSUPDATE_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <netinet/in.h>
/* Write a DNS UPDATE request to `dst'. The request will be to delete
* an A record for `domain' in `zone', then add it again with the
* address `addr' and time to live of `ttl' seconds. Returns the
* first octet after the message. */
unsigned char *wire_dnsupdate_message(unsigned char *dst, const char *zone,
const char *domain, struct in_addr addr, uint32_t ttl);
/* Sign `query' by writing the cryptographic signature to `dst'.
* `query' is the full query except for the signature field of the
* SIG(0) record at the very end. The SIG(0) record of `query' must
* begin at `rr_start'; and this record's signature field at `dst'.
* Returns the first octet after the signed query (which is therefore
* also the end of the SIG(0) record and the SIG(0) record's
* signature). */
unsigned char *sign_query(
unsigned char *dst, const char *query, const char *rr_start);
/* Append a SIG(0) RR to the end of `query' (pointed to by `dst') and
* adjust the payload RR counts. The key should identify the entity
* given by `keyname', which is assumed to be a domain name. Returns
* the first octet after the signed message. */
unsigned char *sign_dnsupdate_message(
unsigned char *dst, unsigned char *query, const char *keyname);
/* Check that `response', of `length' octets, indicates that a message
* generated with `wire_dnsupdate_message' was successful. */
void check_dnsupdate_response(const unsigned char *response, size_t length);
#endif /* !defined(DNSUPDATE_H) */