Skip to content

Commit f320128

Browse files
authored
Change port from uint16_t to uint32_t, to support VSOCK (#665)
1 parent 1da5244 commit f320128

File tree

22 files changed

+32
-32
lines changed

22 files changed

+32
-32
lines changed

discovery/include/aws/discovery/ConnectivityInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Aws
2525
Aws::Crt::Optional<Aws::Crt::String> ID;
2626
Aws::Crt::Optional<Aws::Crt::String> HostAddress;
2727
Aws::Crt::Optional<Aws::Crt::String> Metadata;
28-
Aws::Crt::Optional<uint16_t> Port;
28+
Aws::Crt::Optional<uint32_t> Port;
2929

3030
private:
3131
static void LoadFromObject(ConnectivityInfo &obj, const Crt::JsonView &doc);

discovery/source/ConnectivityInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Aws
2222

2323
if (doc.KeyExists("PortNumber"))
2424
{
25-
obj.Port = static_cast<uint16_t>(doc.GetInteger("PortNumber"));
25+
obj.Port = static_cast<uint32_t>(doc.GetInteger("PortNumber"));
2626
}
2727

2828
if (doc.KeyExists("Metadata"))

discovery/source/DiscoveryClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace Aws
4141
}
4242

4343
Crt::Io::TlsConnectionOptions tlsConnectionOptions = clientConfig.TlsContext->NewConnectionOptions();
44-
uint16_t port = 443;
44+
uint32_t port = 443;
4545

4646
if (Crt::Io::TlsContextOptions::IsAlpnSupported())
4747
{

eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace Aws
151151
public:
152152
ConnectionConfig() noexcept : m_clientBootstrap(nullptr), m_connectRequestCallback(nullptr) {}
153153
Crt::Optional<Crt::String> GetHostName() const noexcept { return m_hostName; }
154-
Crt::Optional<uint16_t> GetPort() const noexcept { return m_port; }
154+
Crt::Optional<uint32_t> GetPort() const noexcept { return m_port; }
155155
Crt::Optional<Crt::Io::SocketOptions> GetSocketOptions() const noexcept { return m_socketOptions; }
156156
Crt::Optional<MessageAmendment> GetConnectAmendment() const noexcept { return m_connectAmendment; }
157157
Crt::Optional<Crt::Io::TlsConnectionOptions> GetTlsConnectionOptions() const noexcept
@@ -166,7 +166,7 @@ namespace Aws
166166
}
167167

168168
void SetHostName(Crt::String hostName) noexcept { m_hostName = hostName; }
169-
void SetPort(uint16_t port) noexcept { m_port = port; }
169+
void SetPort(uint32_t port) noexcept { m_port = port; }
170170
void SetSocketOptions(const Crt::Io::SocketOptions &socketOptions) noexcept
171171
{
172172
m_socketOptions = socketOptions;
@@ -190,7 +190,7 @@ namespace Aws
190190

191191
protected:
192192
Crt::Optional<Crt::String> m_hostName;
193-
Crt::Optional<uint16_t> m_port;
193+
Crt::Optional<uint32_t> m_port;
194194
Crt::Optional<Crt::Io::SocketOptions> m_socketOptions;
195195
Crt::Optional<Crt::Io::TlsConnectionOptions> m_tlsConnectionOptions;
196196
Crt::Io::ClientBootstrap *m_clientBootstrap;

samples/device_defender/basic_report/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ int main(int argc, char *argv[])
8383
{
8484
Aws::Crt::Http::HttpClientConnectionProxyOptions proxyOptions;
8585
proxyOptions.HostName = cmdData.input_proxyHost;
86-
proxyOptions.Port = static_cast<uint16_t>(cmdData.input_proxyPort);
86+
proxyOptions.Port = static_cast<uint32_t>(cmdData.input_proxyPort);
8787
proxyOptions.AuthType = Aws::Crt::Http::AwsHttpProxyAuthenticationType::None;
8888
clientConfigBuilder.WithHttpProxyOptions(proxyOptions);
8989
}
9090
if (cmdData.input_port != 0)
9191
{
92-
clientConfigBuilder.WithPortOverride(static_cast<uint16_t>(cmdData.input_port));
92+
clientConfigBuilder.WithPortOverride(static_cast<uint32_t>(cmdData.input_port));
9393
}
9494

9595
// Create the MQTT connection from the MQTT builder

samples/device_defender/mqtt5_basic_report/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ int main(int argc, char *argv[])
8383
{
8484
Aws::Crt::Http::HttpClientConnectionProxyOptions proxyOptions;
8585
proxyOptions.HostName = cmdData.input_proxyHost;
86-
proxyOptions.Port = static_cast<uint16_t>(cmdData.input_proxyPort);
86+
proxyOptions.Port = static_cast<uint32_t>(cmdData.input_proxyPort);
8787
proxyOptions.AuthType = Aws::Crt::Http::AwsHttpProxyAuthenticationType::None;
8888
clientConfigBuilder->WithHttpProxyOptions(proxyOptions);
8989
}
9090
if (cmdData.input_port != 0)
9191
{
92-
clientConfigBuilder->WithPort(static_cast<uint16_t>(cmdData.input_port));
92+
clientConfigBuilder->WithPort(static_cast<uint32_t>(cmdData.input_port));
9393
}
9494

9595
std::promise<bool> connectionPromise;

samples/fleet_provisioning/mqtt5_fleet_provisioning/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
9595
builder->WithConnectOptions(connectOptions);
9696
if (cmdData.input_port != 0)
9797
{
98-
builder->WithPort(static_cast<uint16_t>(cmdData.input_port));
98+
builder->WithPort(static_cast<uint32_t>(cmdData.input_port));
9999
}
100100

101101
std::promise<bool> connectionPromise;
@@ -465,4 +465,4 @@ int main(int argc, char *argv[])
465465
}
466466

467467
return 0;
468-
}
468+
}

samples/greengrass/basic_discovery/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
8282
if (cmdData.input_proxyHost.length() > 0 && cmdData.input_proxyPort != 0)
8383
{
8484
proxyOptions.HostName = cmdData.input_proxyHost;
85-
proxyOptions.Port = static_cast<uint16_t>(cmdData.input_proxyPort);
85+
proxyOptions.Port = static_cast<uint32_t>(cmdData.input_proxyPort);
8686
clientConfig.ProxyOptions = proxyOptions;
8787
}
8888

0 commit comments

Comments
 (0)