1212require 'openscap/exceptions'
1313require 'openscap/xccdf/item'
1414require 'openscap/xccdf/fix'
15+ require 'openscap/xccdf/ident'
1516
1617module OpenSCAP
1718 module Xccdf
@@ -38,6 +39,17 @@ def fixes
3839 OpenSCAP . xccdf_fix_iterator_free items_it
3940 fixes
4041 end
42+
43+ def idents
44+ idenss = [ ]
45+ idenss_it = OpenSCAP . xccdf_rule_get_idents ( @raw )
46+ while OpenSCAP . xccdf_ident_iterator_has_more idenss_it
47+ idens = OpenSCAP ::Xccdf ::Ident . new ( OpenSCAP . xccdf_ident_iterator_next ( idenss_it ) )
48+ idenss << idens
49+ end
50+ OpenSCAP . xccdf_ident_iterator_free idenss_it
51+ idenss
52+ end
4153 end
4254 end
4355 XccdfSeverity = enum (
@@ -53,4 +65,9 @@ def fixes
5365 attach_function :xccdf_fix_iterator_has_more , [ :pointer ] , :bool
5466 attach_function :xccdf_fix_iterator_next , [ :pointer ] , :pointer
5567 attach_function :xccdf_fix_iterator_free , [ :pointer ] , :void
68+
69+ attach_function :xccdf_rule_get_idents , [ :pointer ] , :pointer
70+ attach_function :xccdf_ident_iterator_has_more , [ :pointer ] , :bool
71+ attach_function :xccdf_ident_iterator_next , [ :pointer ] , :pointer
72+ attach_function :xccdf_ident_iterator_free , [ :pointer ] , :void
5673end
0 commit comments