1
1
use std:: mem:: MaybeUninit ;
2
2
3
+ #[ cfg( ossl110) ]
3
4
use ffi:: {
4
5
ASIdOrRange_id , ASIdOrRange_range , ASIdentifierChoice_asIdsOrRanges ,
5
6
ASIdentifierChoice_inherit , IPAddressChoice_addressesOrRanges , X509v3_addr_get_afi ,
6
7
X509v3_addr_get_range , ASN1_INTEGER , IANA_AFI_IPV4 , IANA_AFI_IPV6 ,
7
8
} ;
9
+ #[ cfg( ossl110) ]
8
10
use foreign_types:: { ForeignType , ForeignTypeRef } ;
9
11
12
+ #[ cfg( ossl110) ]
10
13
use crate :: {
11
14
asn1:: Asn1IntegerRef ,
12
15
stack:: { Stack , StackRef , Stackable } ,
13
16
util:: { ForeignTypeExt , ForeignTypeRefExt } ,
14
17
} ;
15
18
19
+ #[ cfg( ossl110) ]
16
20
use super :: X509 ;
17
21
22
+ #[ cfg( ossl110) ]
18
23
foreign_type_and_impl_send_sync ! {
19
24
type CType = ffi:: ASIdOrRange ;
20
25
fn drop = ffi:: ASIdOrRange_free ;
@@ -24,11 +29,12 @@ foreign_type_and_impl_send_sync! {
24
29
/// Reference to `ASIdOrRange`.
25
30
pub struct ASIdOrRangeRef ;
26
31
}
27
-
32
+ # [ cfg ( ossl110 ) ]
28
33
impl Stackable for ASIdOrRange {
29
34
type StackType = ffi:: stack_st_ASIdOrRange ;
30
35
}
31
36
37
+ #[ cfg( ossl110) ]
32
38
foreign_type_and_impl_send_sync ! {
33
39
type CType = ffi:: ASIdentifiers ;
34
40
fn drop = ffi:: ASIdentifiers_free ;
@@ -39,6 +45,7 @@ foreign_type_and_impl_send_sync! {
39
45
pub struct ASIdentifiersRef ;
40
46
}
41
47
48
+ #[ cfg( ossl110) ]
42
49
impl ASIdentifiers {
43
50
pub fn inherited ( & self ) -> bool {
44
51
unsafe {
@@ -109,16 +116,19 @@ foreign_type_and_impl_send_sync! {
109
116
pub struct IPAddressFamilyRef ;
110
117
}
111
118
119
+ #[ cfg( ossl110) ]
112
120
impl Stackable for IPAddressFamily {
113
121
type StackType = ffi:: stack_st_IPAddressFamily ;
114
122
}
115
123
116
124
#[ derive( PartialEq , Eq , Debug ) ]
125
+ #[ cfg( ossl110) ]
117
126
pub enum IPVersion {
118
127
V4 ,
119
128
V6 ,
120
129
}
121
130
131
+ #[ cfg( ossl110) ]
122
132
impl IPAddressFamily {
123
133
pub fn fam ( & self ) -> Option < IPVersion > {
124
134
let ptr = self . 0 ;
@@ -180,11 +190,13 @@ impl IPAddressFamily {
180
190
}
181
191
}
182
192
193
+ #[ cfg( ossl110) ]
183
194
pub trait ExtractSBGPInfo {
184
195
fn asn ( & self ) -> Option < ASIdentifiers > ;
185
196
fn ip_addresses ( & self ) -> Option < Stack < IPAddressFamily > > ;
186
197
}
187
198
199
+ #[ cfg( ossl110) ]
188
200
impl ExtractSBGPInfo for X509 {
189
201
fn asn ( & self ) -> Option < ASIdentifiers > {
190
202
unsafe {
0 commit comments