forked from erikoest/DNS-LDNS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LDNS.xs
3434 lines (2949 loc) · 62.3 KB
/
LDNS.xs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "ldns/ldns.h"
#include "ldns/error.h"
#include "ldns/rr.h"
#include "ldns/keys.h"
#include "ldns/dname.h"
#include "ldns/host2str.h"
#include "ldns/rdata.h"
#include "ldns/rbtree.h"
#include "ldns/resolver.h"
#include "ldns/packet.h"
#include "ldns/dnssec.h"
#include "ldns/dnssec_zone.h"
#include "ldns/dnssec_verify.h"
#include "ldns/dnssec_sign.h"
#include "ldns/rr_functions.h"
#if LDNS_REVISION < ((1<<16)|(6<<8)|(17))
#define LDNS_RDF_TYPE_HIP LDNS_RDF_TYPE_TSIG
#endif
#include "const-c.inc"
typedef ldns_zone * DNS__LDNS__Zone;
typedef ldns_rr_list * DNS__LDNS__RRList;
typedef ldns_rr * DNS__LDNS__RR;
typedef ldns_rr * DNS__LDNS__RR__Opt;
typedef ldns_rdf * DNS__LDNS__RData;
typedef ldns_rdf * DNS__LDNS__RData__Opt;
typedef ldns_dnssec_zone * DNS__LDNS__DNSSecZone;
typedef ldns_dnssec_rrsets * DNS__LDNS__DNSSecRRSets;
typedef ldns_dnssec_rrs * DNS__LDNS__DNSSecRRs;
typedef ldns_dnssec_name * DNS__LDNS__DNSSecName;
typedef ldns_rbtree_t * DNS__LDNS__RBTree;
typedef ldns_rbnode_t * DNS__LDNS__RBNode;
typedef ldns_resolver * DNS__LDNS__Resolver;
typedef ldns_pkt * DNS__LDNS__Packet;
typedef ldns_key * DNS__LDNS__Key;
typedef ldns_key_list * DNS__LDNS__KeyList;
typedef ldns_dnssec_data_chain * DNS__LDNS__DNSSecDataChain;
typedef ldns_dnssec_trust_tree * DNS__LDNS__DNSSecTrustTree;
typedef const char * Mortal_PV;
typedef ldns_pkt_opcode LDNS_Pkt_Opcode;
typedef ldns_pkt_rcode LDNS_Pkt_Rcode;
typedef ldns_pkt_section LDNS_Pkt_Section;
typedef ldns_pkt_type LDNS_Pkt_Type;
typedef ldns_rr_type LDNS_RR_Type;
typedef ldns_rr_class LDNS_RR_Class;
typedef ldns_rdf_type LDNS_RDF_Type;
typedef ldns_hash LDNS_Hash;
typedef ldns_status LDNS_Status;
typedef ldns_signing_algorithm LDNS_Signing_Algorithm;
/* callback function used by the signing methods */
int sign_policy(ldns_rr *sig, void *n) {
return *(uint16_t*)n;
}
/* utility methods */
void add_cloned_rrs_to_list(ldns_rr_list * list, ldns_rr_list * add) {
size_t count;
size_t i;
count = ldns_rr_list_rr_count(add);
for(i = 0; i < count; i++) {
ldns_rr_list_push_rr(list, ldns_rr_clone(ldns_rr_list_rr(add, i)));
}
}
#if LDNS_REVISION < ((1<<16)|(6<<8)|(12))
ldns_dnssec_trust_tree *ldns_dnssec_derive_trust_tree_time(
ldns_dnssec_data_chain *data_chain,
ldns_rr *rr, time_t check_time);
ldns_rr_list *ldns_fetch_valid_domain_keys_time(const ldns_resolver * res,
const ldns_rdf * domain, const ldns_rr_list * keys,
time_t check_time, ldns_status *status);
ldns_rr_list *ldns_validate_domain_dnskey_time(
const ldns_resolver *res, const ldns_rdf *domain,
const ldns_rr_list *keys, time_t check_time);
ldns_rr_list *ldns_validate_domain_ds_time(
const ldns_resolver *res, const ldns_rdf *domain,
const ldns_rr_list * keys, time_t check_time);
ldns_status ldns_verify_rrsig_keylist_time(
ldns_rr_list *rrset, ldns_rr *rrsig,
const ldns_rr_list *keys, time_t check_time,
ldns_rr_list *good_keys);
ldns_status ldns_verify_trusted_time(
ldns_resolver *res, ldns_rr_list *rrset,
ldns_rr_list *rrsigs, time_t check_time,
ldns_rr_list *validating_keys);
ldns_status ldns_verify_rrsig_time(
ldns_rr_list *rrset, ldns_rr *rrsig,
ldns_rr *key, time_t check_time);
ldns_status ldns_verify_time(ldns_rr_list *rrset,
ldns_rr_list *rrsig,
const ldns_rr_list *keys,
time_t check_time,
ldns_rr_list *good_keys);
ldns_dnssec_trust_tree *ldns_dnssec_derive_trust_tree_time(
ldns_dnssec_data_chain *data_chain,
ldns_rr *rr, time_t check_time) {
Perl_croak(aTHX_ "function ldns_dnssec_derive_trust_tree_time is not implemented in this version of ldns");
}
ldns_rr_list *ldns_fetch_valid_domain_keys_time(const ldns_resolver * res,
const ldns_rdf * domain, const ldns_rr_list * keys,
time_t check_time, ldns_status *status) {
Perl_croak(aTHX_ "function ldns_fetch_valid_domain_keys_time is not implemented in this version of ldns");
}
ldns_rr_list *ldns_validate_domain_dnskey_time(
const ldns_resolver *res, const ldns_rdf *domain,
const ldns_rr_list *keys, time_t check_time) {
Perl_croak(aTHX_ "function ldns_validate_domain_dnskey_time is not implemented in this version of ldns");
}
ldns_rr_list *ldns_validate_domain_ds_time(
const ldns_resolver *res, const ldns_rdf *domain,
const ldns_rr_list * keys, time_t check_time) {
Perl_croak(aTHX_ "function ldns_validate_domain_ds_time is not implemented in this version of ldns");
}
ldns_status ldns_verify_rrsig_keylist_time(
ldns_rr_list *rrset, ldns_rr *rrsig,
const ldns_rr_list *keys, time_t check_time,
ldns_rr_list *good_keys) {
Perl_croak(aTHX_ "function ldns_verify_rrsig_keylist_time is not implemented in this version of ldns");
}
ldns_status ldns_verify_trusted_time(
ldns_resolver *res, ldns_rr_list *rrset,
ldns_rr_list *rrsigs, time_t check_time,
ldns_rr_list *validating_keys) {
Perl_croak(aTHX_ "function ldns_verify_trusted_time is not implemented in this version of ldns");
}
ldns_status ldns_verify_rrsig_time(
ldns_rr_list *rrset, ldns_rr *rrsig,
ldns_rr *key, time_t check_time) {
Perl_croak(aTHX_ "function ldns_verify_rrsig_time is not implemented in this version of ldns");
}
ldns_status ldns_verify_time(ldns_rr_list *rrset,
ldns_rr_list *rrsig,
const ldns_rr_list *keys,
time_t check_time,
ldns_rr_list *good_keys) {
Perl_croak(aTHX_ "function ldns_verify_time is not implemented in this version of ldns");
}
#endif
MODULE = DNS::LDNS PACKAGE = DNS::LDNS
INCLUDE: const-xs.inc
const char *
ldns_get_errorstr_by_id(s)
LDNS_Status s
ALIAS:
errorstr_by_id = 1
Mortal_PV
ldns_rr_type2str(type)
LDNS_RR_Type type;
ALIAS:
rr_type2str = 1
Mortal_PV
ldns_rr_class2str(class)
LDNS_RR_Class class;
ALIAS:
rr_class2str = 1
Mortal_PV
ldns_pkt_opcode2str(opcode)
LDNS_Pkt_Opcode opcode;
ALIAS:
pkt_opcode2str = 1
Mortal_PV
ldns_pkt_rcode2str(rcode)
LDNS_Pkt_Rcode rcode;
ALIAS:
pkt_rcode2str = 1
LDNS_RR_Type
ldns_get_rr_type_by_name(name)
char * name;
ALIAS:
rr_type_by_name = 1
LDNS_RR_Class
ldns_get_rr_class_by_name(name)
char * name;
ALIAS:
rr_class_by_name = 1
DNS__LDNS__RR
ldns_dnssec_create_nsec(from, to, nsec_type)
DNS__LDNS__DNSSecName from;
DNS__LDNS__DNSSecName to;
LDNS_RR_Type nsec_type;
ALIAS:
dnssec_create_nsec = 1
DNS__LDNS__RR
dnssec_create_nsec3(from, to, zone_name, algorithm, flags, iterations, salt)
DNS__LDNS__DNSSecName from;
DNS__LDNS__DNSSecName to;
DNS__LDNS__RData zone_name;
uint8_t algorithm;
uint8_t flags;
uint16_t iterations;
char * salt;
CODE:
RETVAL = ldns_dnssec_create_nsec3(from, to, zone_name, algorithm, flags, iterations, strlen(salt), (uint8_t*)salt);
OUTPUT:
RETVAL
DNS__LDNS__RR
ldns_create_nsec(current, next, rrs)
DNS__LDNS__RData current;
DNS__LDNS__RData next;
DNS__LDNS__RRList rrs;
ALIAS:
create_nsec = 1
DNS__LDNS__RR
create_nsec3(cur_owner, cur_zone, rrs, algorithm, flags, iterations, salt, emptynonterminal)
DNS__LDNS__RData cur_owner;
DNS__LDNS__RData cur_zone;
DNS__LDNS__RRList rrs;
uint8_t algorithm;
uint8_t flags;
uint16_t iterations;
char * salt;
bool emptynonterminal;
CODE:
RETVAL = ldns_create_nsec3(cur_owner, cur_zone, rrs, algorithm,
flags, iterations, strlen(salt), (uint8_t*)salt, emptynonterminal);
OUTPUT:
RETVAL
LDNS_Signing_Algorithm
ldns_get_signing_algorithm_by_name(name)
const char * name;
ALIAS:
signing_algorithm_by_name = 1
int
ldns_key_algo_supported(algorithm)
int algorithm;
ALIAS:
key_algorithm_supported = 1
DNS__LDNS__RR
ldns_read_anchor_file(filename)
char * filename;
ALIAS:
read_anchor_file = 1
MODULE = DNS::LDNS PACKAGE = DNS::LDNS::GC
void
ldns_zone_deep_free(zone)
DNS__LDNS__Zone zone;
ALIAS:
_zone_deep_free = 1
void
ldns_rr_list_deep_free(list)
DNS__LDNS__RRList list;
ALIAS:
_rrlist_deep_free = 1
void
ldns_rr_free(rr)
DNS__LDNS__RR rr;
ALIAS:
_rr_free = 1
void
ldns_rdf_deep_free(rdf)
DNS__LDNS__RData rdf;
ALIAS:
_rdata_deep_free = 1
void
ldns_dnssec_zone_deep_free(zone)
DNS__LDNS__DNSSecZone zone;
ALIAS:
_dnssec_zone_deep_free = 1
void
ldns_dnssec_name_deep_free(name)
DNS__LDNS__DNSSecName name;
ALIAS:
_dnssec_name_deep_free = 1
void
ldns_resolver_deep_free(resolver)
DNS__LDNS__Resolver resolver;
ALIAS:
_resolver_deep_free = 1
void
ldns_pkt_free(pkt)
DNS__LDNS__Packet pkt;
ALIAS:
_packet_free = 1
void
ldns_key_deep_free(key)
DNS__LDNS__Key key;
ALIAS:
_key_deep_free = 1
void
ldns_key_list_free(keylist)
DNS__LDNS__KeyList keylist;
ALIAS:
_keylist_free = 1
void
ldns_dnssec_data_chain_deep_free(chain)
DNS__LDNS__DNSSecDataChain chain;
ALIAS:
_dnssec_datachain_deep_free = 1
void
ldns_dnssec_trust_tree_free(tree)
DNS__LDNS__DNSSecTrustTree tree;
ALIAS:
_dnssec_trusttree_free = 1
MODULE = DNS::LDNS PACKAGE = DNS::LDNS::Zone
PROTOTYPES: ENABLE
DNS__LDNS__Zone
ldns_zone_new()
ALIAS:
_new = 1
DNS__LDNS__Zone
_new_from_file(fp, origin, ttl, c, s, line_nr)
FILE* fp;
DNS__LDNS__RData__Opt origin;
uint32_t ttl;
LDNS_RR_Class c;
LDNS_Status s;
int line_nr;
PREINIT:
ldns_zone *z;
CODE:
if (ttl == 0) { ttl = 0; }
RETVAL = NULL;
s = ldns_zone_new_frm_fp_l(&z, fp, origin, ttl, c, &line_nr);
if (s == LDNS_STATUS_OK) {
RETVAL = z;
}
OUTPUT:
RETVAL
s
line_nr
void
print(zone, fp)
DNS__LDNS__Zone zone;
FILE* fp;
CODE:
ldns_zone_print(fp, zone);
void
canonicalize(zone)
DNS__LDNS__Zone zone;
PREINIT:
ldns_rr_list *list;
size_t count;
size_t i;
CODE:
list = ldns_zone_rrs(zone);
count = ldns_rr_list_rr_count(list);
ldns_rr2canonical(ldns_zone_soa(zone));
for (i = 0; i < ldns_rr_list_rr_count(ldns_zone_rrs(zone)); i++) {
ldns_rr2canonical(ldns_rr_list_rr(ldns_zone_rrs(zone), i));
}
void
ldns_zone_sort(zone)
DNS__LDNS__Zone zone;
ALIAS:
sort = 1
DNS__LDNS__RR
ldns_zone_soa(zone)
DNS__LDNS__Zone zone;
ALIAS:
_soa = 1
void
ldns_zone_set_soa(zone, soa)
DNS__LDNS__Zone zone;
DNS__LDNS__RR soa;
ALIAS:
_set_soa = 1
DNS__LDNS__RRList
ldns_zone_rrs(zone)
DNS__LDNS__Zone zone;
ALIAS:
_rrs = 1
void
ldns_zone_set_rrs(zone, list)
DNS__LDNS__Zone zone;
DNS__LDNS__RRList list;
ALIAS:
_set_rrs = 1
DNS__LDNS__Zone
ldns_zone_sign(zone, keylist)
DNS__LDNS__Zone zone;
DNS__LDNS__KeyList keylist;
ALIAS:
sign = 1
DNS__LDNS__Zone
sign_nsec3(zone, keylist, algorithm, flags, iterations, salt)
DNS__LDNS__Zone zone;
DNS__LDNS__KeyList keylist;
uint8_t algorithm;
uint8_t flags;
uint16_t iterations;
unsigned char * salt;
CODE:
RETVAL = ldns_zone_sign_nsec3(zone, keylist, algorithm, flags, iterations, strlen(salt), (uint8_t*)salt);
OUTPUT:
RETVAL
MODULE = DNS::LDNS PACKAGE = DNS::LDNS::RRList
PROTOTYPES: ENABLE
DNS__LDNS__RRList
ldns_rr_list_new()
ALIAS:
_new = 1
DNS__LDNS__RRList
_new_hosts_from_file(fp, line_nr)
FILE * fp;
int line_nr;
CODE:
RETVAL = ldns_get_rr_list_hosts_frm_fp_l(fp, &line_nr);
OUTPUT:
RETVAL
DNS__LDNS__RRList
ldns_rr_list_clone(list)
DNS__LDNS__RRList list;
ALIAS:
clone = 1
void
print(list, fp)
DNS__LDNS__RRList list;
FILE* fp;
CODE:
ldns_rr_list_print(fp, list);
Mortal_PV
ldns_rr_list2str(list)
DNS__LDNS__RRList list;
ALIAS:
to_string = 1
DNS__LDNS__RR
ldns_rr_list_rr(list, i)
DNS__LDNS__RRList list;
size_t i;
ALIAS:
_rr = 1
DNS__LDNS__RR
ldns_rr_list_pop_rr(list)
DNS__LDNS__RRList list;
ALIAS:
pop = 1
bool
ldns_rr_list_push_rr(list, rr)
DNS__LDNS__RRList list;
DNS__LDNS__RR rr;
ALIAS:
_push = 1
size_t
ldns_rr_list_rr_count(list)
DNS__LDNS__RRList list;
ALIAS:
rr_count = 1
int
ldns_rr_list_compare(list, otherlist)
DNS__LDNS__RRList list;
DNS__LDNS__RRList otherlist;
ALIAS:
compare = 1
DNS__LDNS__RRList
ldns_rr_list_subtype_by_rdf(list, rdf, pos)
DNS__LDNS__RRList list;
DNS__LDNS__RData rdf;
size_t pos;
ALIAS:
subtype_by_rdata = 1
DNS__LDNS__RRList
ldns_rr_list_pop_rrset(list)
DNS__LDNS__RRList list;
ALIAS:
pop_rrset = 1
bool
ldns_is_rrset(list)
DNS__LDNS__RRList list;
ALIAS:
is_rrset = 1
bool
ldns_rr_list_contains_rr(list, rr)
DNS__LDNS__RRList list;
DNS__LDNS__RR rr;
ALIAS:
contains_rr = 1
DNS__LDNS__RRList
ldns_rr_list_pop_rr_list(list, count)
DNS__LDNS__RRList list;
size_t count;
ALIAS:
pop_list = 1
bool
_push_list(list, otherlist)
DNS__LDNS__RRList list;
DNS__LDNS__RRList otherlist;
PREINIT:
bool ret;
CODE:
ret = ldns_rr_list_push_rr_list(list, otherlist);
if (ret) {
ldns_rr_list_free(otherlist);
}
OUTPUT:
RETVAL
LDNS_Status
_verify_rrsig_keylist(rrset, rrsig, keys, good_keys)
DNS__LDNS__RRList rrset;
DNS__LDNS__RR rrsig;
DNS__LDNS__RRList keys;
DNS__LDNS__RRList good_keys;
PREINIT:
DNS__LDNS__RRList gk;
CODE:
gk = ldns_rr_list_new();
RETVAL = ldns_verify_rrsig_keylist(rrset, rrsig, keys, good_keys);
add_cloned_rrs_to_list(good_keys, gk);
ldns_rr_list_free(gk);
OUTPUT:
RETVAL
LDNS_Status
_verify_rrsig_keylist_time(rrset, rrsig, keys, check_time, good_keys)
DNS__LDNS__RRList rrset;
DNS__LDNS__RR rrsig;
DNS__LDNS__RRList keys;
time_t check_time;
DNS__LDNS__RRList good_keys;
PREINIT:
DNS__LDNS__RRList gk;
CODE:
gk = ldns_rr_list_new();
RETVAL = ldns_verify_rrsig_keylist_time(
rrset, rrsig, keys, check_time, good_keys);
add_cloned_rrs_to_list(good_keys, gk);
ldns_rr_list_free(gk);
OUTPUT:
RETVAL
LDNS_Status
_verify_rrsig_keylist_notime(rrset, rrsig, keys, good_keys)
DNS__LDNS__RRList rrset;
DNS__LDNS__RR rrsig;
DNS__LDNS__RRList keys;
DNS__LDNS__RRList good_keys;
PREINIT:
DNS__LDNS__RRList gk;
CODE:
gk = ldns_rr_list_new();
RETVAL = ldns_verify_rrsig_keylist_notime(rrset, rrsig, keys, NULL);
add_cloned_rrs_to_list(good_keys, gk);
ldns_rr_list_free(gk);
OUTPUT:
RETVAL
LDNS_Status
ldns_verify_rrsig(rrset, rrsig, key)
DNS__LDNS__RRList rrset;
DNS__LDNS__RR rrsig;
DNS__LDNS__RR key;
ALIAS:
_verify_rrsig = 1
LDNS_Status
ldns_verify_rrsig_time(rrset, rrsig, key, check_time)
DNS__LDNS__RRList rrset;
DNS__LDNS__RR rrsig;
DNS__LDNS__RR key;
time_t check_time;
ALIAS:
_verify_rrsig_time = 1
LDNS_Status
_verify(rrset, rrsig, keys, good_keys)
DNS__LDNS__RRList rrset;
DNS__LDNS__RRList rrsig;
DNS__LDNS__RRList keys;
DNS__LDNS__RRList good_keys;
PREINIT:
DNS__LDNS__RRList gk;
CODE:
gk = ldns_rr_list_new();
RETVAL = ldns_verify(rrset, rrsig, keys, gk);
add_cloned_rrs_to_list(good_keys, gk);
ldns_rr_list_free(gk);
OUTPUT:
RETVAL
LDNS_Status
_verify_time(rrset, rrsig, keys, check_time, good_keys)
DNS__LDNS__RRList rrset;
DNS__LDNS__RRList rrsig;
DNS__LDNS__RRList keys;
time_t check_time;
DNS__LDNS__RRList good_keys;
PREINIT:
DNS__LDNS__RRList gk;
CODE:
gk = ldns_rr_list_new();
RETVAL = ldns_verify_time(rrset, rrsig, keys, check_time, gk);
add_cloned_rrs_to_list(good_keys, gk);
ldns_rr_list_free(gk);
OUTPUT:
RETVAL
LDNS_Status
_verify_notime(rrset, rrsig, keys, good_keys)
DNS__LDNS__RRList rrset;
DNS__LDNS__RRList rrsig;
DNS__LDNS__RRList keys;
DNS__LDNS__RRList good_keys;
PREINIT:
DNS__LDNS__RRList gk;
CODE:
gk = ldns_rr_list_new();
RETVAL = ldns_verify_notime(rrset, rrsig, keys, gk);
add_cloned_rrs_to_list(good_keys, gk);
ldns_rr_list_free(gk);
OUTPUT:
RETVAL
DNS__LDNS__RR
ldns_create_empty_rrsig(rrset, current_key)
DNS__LDNS__RRList rrset;
DNS__LDNS__Key current_key;
ALIAS:
create_empty_rrsig = 1
DNS__LDNS__RRList
ldns_sign_public(rrset, keys)
DNS__LDNS__RRList rrset;
DNS__LDNS__KeyList keys;
ALIAS:
sign_public = 1
void
ldns_rr_list_sort(list)
DNS__LDNS__RRList list;
ALIAS:
sort = 1
void
ldns_rr_list_sort_nsec3(list)
DNS__LDNS__RRList list;
ALIAS:
sort_nsec3 = 1
void
ldns_rr_list2canonical(list)
DNS__LDNS__RRList list;
ALIAS:
canonicalize = 1
DNS__LDNS__RR
ldns_dnssec_get_dnskey_for_rrsig(rr, rrlist)
DNS__LDNS__RR rr;
DNS__LDNS__RRList rrlist;
ALIAS:
_get_dnskey_for_rrsig = 1
DNS__LDNS__RR
ldns_dnssec_get_rrsig_for_name_and_type(name, type, rrsigs)
DNS__LDNS__RData name;
LDNS_RR_Type type;
DNS__LDNS__RRList rrsigs;
ALIAS:
_get_rrsig_for_name_and_type = 1
MODULE = DNS::LDNS PACKAGE = DNS::LDNS::RR
PROTOTYPES: ENABLE
DNS__LDNS__RR
ldns_rr_new()
ALIAS:
_new = 1
DNS__LDNS__RR
ldns_rr_new_frm_type(t)
LDNS_RR_Type t;
ALIAS:
_new_from_type = 1
DNS__LDNS__RR
_new_from_str(str, default_ttl, origin, prev, s)
const char* str;
uint32_t default_ttl;
DNS__LDNS__RData__Opt origin;
DNS__LDNS__RData__Opt prev;
LDNS_Status s;
PREINIT:
DNS__LDNS__RR rr = NULL;
ldns_rdf *pclone = NULL;
CODE:
if (prev != NULL) {
pclone = ldns_rdf_clone(prev);
}
s = ldns_rr_new_frm_str(&rr, str, default_ttl, origin, &prev);
if (prev != NULL) {
prev = pclone;
}
if (s == LDNS_STATUS_OK) {
RETVAL = rr;
}
OUTPUT:
RETVAL
s
prev
DNS__LDNS__RR
_new_from_file(fp, default_ttl, origin, prev, s, line_nr)
FILE* fp;
uint32_t default_ttl;
DNS__LDNS__RData__Opt origin;
DNS__LDNS__RData__Opt prev;
LDNS_Status s;
int line_nr;
PREINIT:
ldns_rr *rr;
ldns_rdf *oclone = NULL;
ldns_rdf *pclone = NULL;
CODE:
/* Must clone origin and prev because new_frm_fp_l may change
them and may not (we do not know for certain). The perl layer
will take care of freeing the old structs. */
if (origin != NULL) {
oclone = ldns_rdf_clone(origin);
}
if (prev != NULL) {
pclone = ldns_rdf_clone(prev);
}
RETVAL = NULL;
s = ldns_rr_new_frm_fp_l(&rr, fp, &default_ttl, &oclone, &pclone,
&line_nr);
/* Replace the input origin with our new clone. The perl layer will
take care of freeing it later. */
if (origin != NULL) {
origin = oclone;
}
if (prev != NULL) {
prev = pclone;
}
if (s == LDNS_STATUS_OK) {
RETVAL = rr;
}
OUTPUT:
RETVAL
s
line_nr
default_ttl
origin
prev
DNS__LDNS__RR
ldns_rr_clone(rr)
DNS__LDNS__RR rr;
ALIAS:
clone = 1
void
ldns_rr_set_owner(rr, owner)
DNS__LDNS__RR rr;
DNS__LDNS__RData owner;
ALIAS:
_set_owner = 1
void
ldns_rr_set_ttl(rr, ttl)
DNS__LDNS__RR rr;
uint32_t ttl;
ALIAS:
set_ttl = 1
void
ldns_rr_set_type(rr, type)
DNS__LDNS__RR rr;
LDNS_RR_Type type;
ALIAS:
set_type = 1
void
ldns_rr_set_class(rr, class)
DNS__LDNS__RR rr;
LDNS_RR_Class class;
ALIAS:
set_class = 1
void
print(rr, fp)
DNS__LDNS__RR rr;
FILE* fp;
CODE:
ldns_rr_print(fp, rr);
Mortal_PV
ldns_rr2str(rr)
DNS__LDNS__RR rr;
ALIAS:
to_string = 1
int
ldns_rr_compare(rr, otherrr)
DNS__LDNS__RR rr;
DNS__LDNS__RR otherrr;
ALIAS:
compare = 1
int
ldns_rr_compare_no_rdata(rr, otherrr)
DNS__LDNS__RR rr;
DNS__LDNS__RR otherrr;
ALIAS:
compare_no_rdata = 1
int
ldns_rr_compare_ds(rr, otherrr)
DNS__LDNS__RR rr;
DNS__LDNS__RR otherrr;
ALIAS:
compare_ds = 1
int
compare_dname(rr, otherrr)
DNS__LDNS__RR rr;
DNS__LDNS__RR otherrr;
CODE:
RETVAL = ldns_dname_compare(
ldns_rr_owner(rr), ldns_rr_owner(otherrr));
OUTPUT:
RETVAL
DNS__LDNS__RData
ldns_rr_owner(rr)
DNS__LDNS__RR rr;
ALIAS:
_owner = 1
size_t
ldns_rr_rd_count(rr);
DNS__LDNS__RR rr;
ALIAS:
rd_count = 1
DNS__LDNS__RData
ldns_rr_rdf(rr, i)
DNS__LDNS__RR rr;
size_t i;
ALIAS:
_rdata = 1
DNS__LDNS__RData
ldns_rr_set_rdf(rr, rdf, i)
DNS__LDNS__RR rr;
DNS__LDNS__RData rdf;
size_t i;
ALIAS:
_set_rdata = 1
uint32_t
ldns_rr_ttl(rr)
DNS__LDNS__RR rr;
ALIAS:
ttl = 1
LDNS_RR_Class
ldns_rr_get_class(rr)
DNS__LDNS__RR rr;
ALIAS:
class = 1
LDNS_RR_Type
ldns_rr_get_type(rr)
DNS__LDNS__RR rr;
ALIAS:
type = 1
DNS__LDNS__RData
ldns_rr_pop_rdf(rr)
DNS__LDNS__RR rr;
ALIAS:
pop_rdata = 1
bool
ldns_rr_push_rdf(rr, rdf)
DNS__LDNS__RR rr;
DNS__LDNS__RData rdf;
ALIAS:
_push_rdata = 1
DNS__LDNS__RData
ldns_rr_rrsig_typecovered(rr)
DNS__LDNS__RR rr;
ALIAS:
_rrsig_typecovered = 1
bool
ldns_rr_rrsig_set_typecovered(rr, rdf)
DNS__LDNS__RR rr;
DNS__LDNS__RData rdf;
ALIAS:
_rrsig_set_typecovered = 1
DNS__LDNS__RData
ldns_rr_rrsig_algorithm(rr)
DNS__LDNS__RR rr;
ALIAS:
_rrsig_algorithm = 1
bool
ldns_rr_rrsig_set_algorithm(rr, rdf)
DNS__LDNS__RR rr;
DNS__LDNS__RData rdf;
ALIAS:
_rrsig_set_algorithm = 1
DNS__LDNS__RData
ldns_rr_rrsig_expiration(rr)
DNS__LDNS__RR rr;
ALIAS:
_rrsig_expiration = 1
bool