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
// imports cvss_component macro

cvss_component!(CollateralDamagePotential {
    None => N,
    Low => L,
    LowMedium => LM,
    MediumHigh => MH,
    High => H,
    NotDefined => ND,
});

cvss_component!(TargetDistribution {
    None => N,
    Low => L,
    Medium => M,
    High => H,
    NotDefined => ND,
});

cvss_component!(SecurityRequirement {
    Low => L,
    Medium => M,
    High => H,
    NotDefined => ND,
});

cvss_score!(EnvironmentMetric {
    collateral_damage_potential: CollateralDamagePotential => CDP,
    target_distribution: TargetDistribution => TD,
    confidentiality_requirement: SecurityRequirement => CR,
    integrity_requirement: SecurityRequirement => IR,
    availability_requirement: SecurityRequirement => AR,
});