Revert D6745720: [folly][compression] Log (de)compression bytes
[folly.git] / folly / IPAddressException.h
index d1830ba61737ea56cdb5b8b1fdbd25e4525bc29b..feb0284cee30f5d6fa2389616f5421c588f3c470 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <exception>
 #include <string>
 #include <utility>
 
+#include <folly/CPortability.h>
 #include <folly/detail/IPAddress.h>
 
 namespace folly {
@@ -29,10 +29,21 @@ namespace folly {
  */
 enum class IPAddressFormatError { INVALID_IP, UNSUPPORTED_ADDR_FAMILY };
 
+/**
+ * Wraps error from parsing IP/MASK string
+ */
+enum class CIDRNetworkError {
+  INVALID_DEFAULT_CIDR,
+  INVALID_IP_SLASH_CIDR,
+  INVALID_IP,
+  INVALID_CIDR,
+  CIDR_MISMATCH,
+};
+
 /**
  * Exception for invalid IP addresses.
  */
-class IPAddressFormatException : public std::exception {
+class FOLLY_EXPORT IPAddressFormatException : public std::exception {
  public:
   explicit IPAddressFormatException(std::string msg) noexcept
       : msg_(std::move(msg)) {}
@@ -51,7 +62,8 @@ class IPAddressFormatException : public std::exception {
   std::string msg_;
 };
 
-class InvalidAddressFamilyException : public IPAddressFormatException {
+class FOLLY_EXPORT InvalidAddressFamilyException
+    : public IPAddressFormatException {
  public:
   explicit InvalidAddressFamilyException(std::string msg) noexcept
       : IPAddressFormatException(std::move(msg)) {}