Fix snmp port out of range

SNMP out of range port doesn't works, it should throw HTTPS 400 error
It went ahead and configures it, with default port which is not the
correct behavior.

Tested: If the snmp port is out of range, a 400 error will be thrown.
```
$ curl --header "Content-Type: application/json" X POST -i -k -u root:0penBmc https://{bmc}/redfish/v1/EventService/Subscriptions --data-raw '{"Destination": "snmp://xx.xx.xx.76:65537","SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c"}' -vv
...

< HTTP/1.1 400 Bad Request
...

{
  "Destination@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The value '\"snmp://xx.xx.xx.76:65537\"' for the property Destination is of a different format than the property can accept.",
      "MessageArgs": [
        "\"snmp://xx.xx.xx.76:65537\"",
        "Destination"
      ],
      "MessageId": "Base.1.16.0.PropertyValueFormatError",
      "MessageSeverity": "Warning",
      "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed."
    }
  ]
* Connection #0 to host 127.0.0.1 left intact
}
```

Change-Id: I6e002153ca37b4eb3d4538a64fa61ab35e9dab85
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
index bef13eb..7510f0f 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -354,6 +354,17 @@
                 return;
             }
             url->normalize();
+
+            // port_number returns zero if it is not a valid representable port
+            if (url->has_port() && url->port_number() == 0)
+            {
+                BMCWEB_LOG_WARNING("{} is an invalid port in destination url",
+                                   url->port());
+                messages::propertyValueFormatError(asyncResp->res, destUrl,
+                                                   "Destination");
+                return;
+            }
+
             crow::utility::setProtocolDefaults(*url, protocol);
             crow::utility::setPortDefaults(*url);