HONEYCOMB-58 - Routing Api
[honeycomb.git] / nat / nat-api / src / main / yang / nat-context.yang
1 module nat-context {
2     yang-version 1;
3     namespace "urn:honeycomb:params:xml:ns:yang:nat:context";
4     prefix "nc";
5
6     description "Context for nat mapping";
7
8     revision "2016-12-14" {
9         description "Initial revision.";
10     }
11
12     import ietf-inet-types {
13        prefix "inet";
14     }
15
16     import naming-context {
17        prefix "nc";
18     }
19
20     import yang-ext {
21        prefix "ext";
22     }
23
24     grouping mapping-entry-context-attributes {
25         container nat-mapping-entry-context {
26             list nat-instance {
27                 key "id";
28
29                 leaf id {
30                     type uint32;
31                     description "ID of the NAT instance from ietf-nat. Maps to VRF-ID in VPP";
32                 }
33
34                 container mapping-table {
35                     list mapping-entry {
36
37                         key "internal external";
38                         unique "index";
39
40                         leaf internal {
41                             type inet:ip-address;
42                             description "Local IP address set in VPP";
43                         }
44
45                         leaf external {
46                             type inet:ip-address;
47                             description "Extarnal IP address set in VPP";
48                         }
49
50                         leaf index {
51                             type uint32;
52                             description "ID of the NAT's mapping entry from ietf-nat";
53                         }
54                     }
55                 }
56             }
57         }
58     }
59
60     augment /nc:contexts {
61         ext:augment-identifier "nat-mapping-entry-ctx-augmentation";
62         uses mapping-entry-context-attributes;
63     }
64 }