Skip to content

Commit

Permalink
show known ports name only for UDP and TCP conns
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainmohd-a committed Sep 9, 2024
1 parent df5cfd8 commit d715e76
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,13 @@ class ConnectionTrackerAdapter(private val context: Context) :
}

private fun displayProtocolDetails(port: Int, proto: Int) {
// Instead of showing the port name and protocol, now the ports are resolved with
// known ports(reserved port and protocol identifiers).
// If the protocol is not TCP or UDP, then display the protocol name.
if (Protocol.UDP.protocolType != proto && Protocol.TCP.protocolType != proto) {
b.connLatencyTxt.text = Protocol.getProtocolName(proto).name
return
}

// Instead of displaying the port number, display the service name if it is known.
// https://github.com/celzero/rethink-app/issues/42 - #3 - transport + protocol.
val resolvedPort = KnownPorts.resolvePort(port)
// case: for UDP/443 label it as HTTP3 instead of HTTPS
Expand Down

0 comments on commit d715e76

Please sign in to comment.