MCPcopy Create free account
hub / github.com/catboost/catboost / GetUdpAddress

Function GetUdpAddress

library/cpp/netliba/v12/udp_address.cpp:173–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 void GetUdpAddress(TUdpAddress* res, const sockaddr_in6& addr) {
174 if (addr.sin6_family == AF_INET) {
175 const sockaddr_in& addr4 = *(const sockaddr_in*)&addr;
176 res->Network = 0;
177 res->Interface = 0xffff0000ll + (((ui64)(ui32)addr4.sin_addr.s_addr) << 32);
178 res->Scope = 0;
179 res->Port = ntohs(addr4.sin_port);
180 } else if (addr.sin6_family == AF_INET6) {
181 res->Network = *BreakAliasing<ui64>(addr.sin6_addr.s6_addr + 0);
182 res->Interface = *BreakAliasing<ui64>(addr.sin6_addr.s6_addr + 8);
183 res->Scope = addr.sin6_scope_id;
184 res->Port = ntohs(addr.sin6_port);
185 }
186 }
187
188 TUdpAddress GetUdpAddress(const sockaddr_in6& addr) {
189 TUdpAddress result;

Callers 5

ProcessPingPacketMethod · 0.70
CheckPacketIntegrityMethod · 0.70
ParseInetNameFunction · 0.70
GetLocalAddressesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected