Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 1 | module msea-sa-filtering { |
| 2 | |
| 3 | /*** NAMESPACE / PREFIX DEFINITION ***/ |
| 4 | |
| 5 | namespace "http://www.microsemi.com/microsemi-edge-assure/msea-sa-filtering"; |
| 6 | prefix "msea-saf"; |
| 7 | |
| 8 | import ietf-inet-types { |
| 9 | prefix inet; |
| 10 | revision-date 2013-07-15; |
| 11 | } |
| 12 | |
| 13 | import msea-types { |
| 14 | prefix msea; |
| 15 | revision-date 2016-02-29; |
| 16 | } |
| 17 | |
| 18 | /*** META INFORMATION ***/ |
| 19 | |
| 20 | organization |
| 21 | "Microsemi Inc., FTD Division"; |
| 22 | |
| 23 | contact |
| 24 | "Web URL: http://www.microsemi.com/ |
| 25 | E-mail: info@microsemi.com |
| 26 | Postal: Microsemi Corporation Corporate Headquarters |
| 27 | One Enterprise Aliso Viejo, |
| 28 | CA 92656 |
| 29 | U.S.A. |
| 30 | Phone: +1 949 380 6100 |
| 31 | Fax: +1 949 215-4996"; |
| 32 | |
| 33 | description |
| 34 | "This YANG module add Source Address Filtering for IPv4 packets to |
| 35 | the Optics(eth0) port (only) of the Edge Assure device. |
| 36 | |
| 37 | Copyright 2016 Microsemi Inc. |
| 38 | All rights reserved."; |
| 39 | |
| 40 | revision "2016-04-12" { |
| 41 | description |
| 42 | "Initial version - Sean Condon, Microsemi"; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | container source-ipaddress-filtering { |
| 47 | presence "Supports IPv4 Source Address Filtering"; |
| 48 | |
| 49 | container interface-eth0 { |
| 50 | |
| 51 | leaf filter-admin-state { |
| 52 | type enumeration { |
| 53 | enum inactive { |
| 54 | description "Source address filtering is inactive"; |
| 55 | } |
| 56 | enum whitelist { |
| 57 | description "Only IPv4 packets from the source |
| 58 | address ranges are allowed in to the device on the |
| 59 | Optics(eth0) port. All non IPv4 packets are not |
| 60 | filtered by this whitelist"; |
| 61 | } |
| 62 | enum blacklist { |
| 63 | description "All IPv4 packets from the source |
| 64 | address ranges are blocked from entering the device |
| 65 | on the Optics(eth0) port. All other packets are not |
| 66 | filtered by this blacklist"; |
| 67 | } |
| 68 | } |
| 69 | default inactive; |
| 70 | description "This attribute sets the address range to be used as |
| 71 | either a whitelist or a blacklist of IPv4 packets. |
| 72 | When activating the filter the user should be careful not to |
| 73 | block or exclude the management IP address of the manager"; |
| 74 | } |
| 75 | |
| 76 | list source-address-range { |
| 77 | key range-id; |
| 78 | max-elements 10; |
| 79 | unique ipv4-address-prefix; |
| 80 | unique name; |
| 81 | |
| 82 | leaf range-id { |
| 83 | type uint8 { |
| 84 | range "1..10"; |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | leaf name { |
| 89 | type string{ |
| 90 | length "1..45"; |
| 91 | } |
| 92 | description "An optional name for the filter range"; |
| 93 | } |
| 94 | |
| 95 | leaf ipv4-address-prefix { |
| 96 | type string { |
| 97 | pattern |
| 98 | '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' |
| 99 | + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' |
| 100 | + '/(([1-9])|(1[0-9])|(2[0-7]))'; |
| 101 | } |
| 102 | |
| 103 | mandatory true; |
| 104 | // msea:not-changeable; |
| 105 | |
| 106 | description |
| 107 | "The ipv4-address-prefix type represents an IPv4 address prefix |
| 108 | in CIDR notation format. e.g. a.b.c.d/n |
| 109 | |
| 110 | It consists of an address part and a mask length part. |
| 111 | The address part is only used up to the number of bits |
| 112 | specified in the length (1-27, given after the slash). |
| 113 | |
| 114 | For example the value 10.10.159.211/20 will mean an |
| 115 | effective range from 10.10.144.0 - 10.10.159.255 and |
| 116 | a count of 2^12 = 4096. The last 12 bits (32-20=12) |
| 117 | of the address is ignored because it is not within the |
| 118 | mask length."; |
| 119 | } |
| 120 | |
| 121 | |
| 122 | container effective-address-range { |
| 123 | config false; |
| 124 | |
| 125 | leaf start-of-range { |
| 126 | type inet:ipv4-address-no-zone; |
| 127 | description "The calculated start of the address range"; |
| 128 | } |
| 129 | |
| 130 | leaf end-of-range { |
| 131 | type inet:ipv4-address-no-zone; |
| 132 | description "The calculated end of the address range"; |
| 133 | } |
| 134 | |
| 135 | leaf count { |
| 136 | type uint32; |
| 137 | description "The number of IPv4 addresses that match the filter"; |
| 138 | } |
| 139 | |
| 140 | description "The effective start and end addresses calculated |
| 141 | from the ipv4-address-prefix"; |
| 142 | } |
| 143 | |
| 144 | description "A set of address ranges to be either blacklisted or |
| 145 | whitelisted on ingress to the eth0(Optics) port of the device"; |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | } |