tsig.h
Go to the documentation of this file.
1 /*
2  * tsig.h -- defines for TSIG [RFC2845]
3  *
4  * Copyright (c) 2005-2008, NLnet Labs. All rights reserved.
5  *
6  * See LICENSE for the license.
7  */
8 
9 #ifndef LDNS_TSIG_H
10 #define LDNS_TSIG_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
27 {
28  char *algorithm;
29  char *keyname;
30  char *keydata;
31  /* XXX More eventually. */
33 
39 
51 bool ldns_pkt_tsig_verify(ldns_pkt *pkt, uint8_t *wire, size_t wire_size, const char *key_name, const char *key_data, ldns_rdf *mac);
52 
66 bool ldns_pkt_tsig_verify_next(ldns_pkt *pkt, uint8_t *wire, size_t wire_size, const char *key_name, const char *key_data, ldns_rdf *mac,
67  int tsig_timers_only);
68 
79 ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge,
80  const char *algorithm_name, ldns_rdf *query_mac);
81 
94 ldns_status ldns_pkt_tsig_sign_next(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge,
95  const char *algorithm_name, ldns_rdf *query_mac, int tsig_timers_only);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* LDNS_TSIG_H */
char * ldns_tsig_keydata_clone(ldns_tsig_credentials *tc)
Definition: tsig.c:46
struct ldns_tsig_credentials_struct ldns_tsig_credentials
Contains credentials for TSIG.
char * ldns_tsig_keyname_clone(ldns_tsig_credentials *tc)
Definition: tsig.c:40
bool ldns_pkt_tsig_verify(ldns_pkt *pkt, uint8_t *wire, size_t wirelen, const char *key_name, const char *key_data, ldns_rdf *orig_mac_rdf)
verifies the tsig rr for the given packet and key.
Definition: tsig.c:280
char * ldns_tsig_keyname(ldns_tsig_credentials *tc)
Definition: tsig.c:28
bool ldns_pkt_tsig_verify_next(ldns_pkt *pkt, uint8_t *wire, size_t wirelen, const char *key_name, const char *key_data, ldns_rdf *orig_mac_rdf, int tsig_timers_only)
verifies the tsig rr for the given packet and key.
Definition: tsig.c:287
DNS packet.
Definition: packet.h:233
char * ldns_tsig_algorithm(ldns_tsig_credentials *tc)
Definition: tsig.c:22
enum ldns_enum_status ldns_status
Definition: error.h:122
ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, ldns_rdf *query_mac)
creates a tsig rr for the given packet and key.
Definition: tsig.c:356
ldns_status ldns_pkt_tsig_sign_next(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, ldns_rdf *query_mac, int tsig_timers_only)
creates a tsig rr for the given packet and key.
Definition: tsig.c:363
Resource record data field.
Definition: rdata.h:138
Contains credentials for TSIG.
Definition: tsig.h:26
char * ldns_tsig_keydata(ldns_tsig_credentials *tc)
Definition: tsig.c:34