Skip to content

Commit

Permalink
Merge branch 'main' into 1212-yang-generate-message
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFey-GIP authored Oct 31, 2024
2 parents b0e73e5 + bc4950e commit d2b5a46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/xfmg/oas/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Application applicationName="OAS_Base" factoryVersion="" versionName="1.4.1" xmlVersion="1.1">
<Application applicationName="OAS_Base" factoryVersion="" versionName="1.4.2" xmlVersion="1.1">
<ApplicationInfo>
<RuntimeContextRequirements>
<RuntimeContextRequirement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class StringTypeValidator extends PrimitiveTypeValidator<String> {
private static final String MAC_ADDRESS = "macaddress"; // same as mac
private static final String IPV4 = "ipv4";
private static final String IPV4_PREFIX = "ipv4prefix"; // address with prefix e.g. 192.168.1.0/24
private static final String IPV4_SUBNET = "ipv4subnet"; // e.g. 255.255.255.0
private static final String IPV4_NETMASK = "ipv4netmask"; // e.g. 255.255.255.0
private static final String IPV6 = "ipv6";
private static final String IPV6_PREFIX = "ipv6prefix"; // address with prefix e.g. 2001:0db8:85a3:08d3:1319:8a2e:0370:7347/64

Expand All @@ -64,7 +64,7 @@ private static Map<String, Function<String, Boolean>> buildFormatValidatorMap()
result.put(MAC_ADDRESS, createFormatValidatorFunction(MAC_ADDRESS_REGEX));
result.put(IPV4, createFormatValidatorFunction(IPV4_REGEX));
result.put(IPV4_PREFIX, createFormatValidatorFunction(IPV4_PREFIX_REGEX));
result.put(IPV4_SUBNET, toCheck -> validateFormat(toCheck, IPV4_SUBNET));
result.put(IPV4_NETMASK, toCheck -> validateFormat(toCheck, IPV4_NETMASK));
result.put(IPV6, toCheck -> validateFormat(toCheck, IPV6));
result.put(IPV6_PREFIX, toCheck -> validateFormat(toCheck, IPV6_PREFIX));

Expand Down Expand Up @@ -169,16 +169,16 @@ private boolean checkFormat() {
private static boolean validateFormat(String toCheck, String format) {
try {
switch (format) {
case "ipv4subnet" :
case IPV4_NETMASK :
IPv4NetmaskData ipv4mask = new IPv4NetmaskData(toCheck);
return true;
case "ipv6prefix" :
case IPV6_PREFIX :
String[] ipv6Prefix = toCheck.split("/");
if (ipv6Prefix.length != 2)
return false;
IPv6NetmaskData ipv6mask = new IPv6NetmaskData(ipv6Prefix[1]);
toCheck = ipv6Prefix[0];
case "ipv6" :
case IPV6 :
IPv6Address ipv6Address = new IPv6Address(toCheck);
return true;
default :
Expand Down

0 comments on commit d2b5a46

Please sign in to comment.