Bugzilla – Bug 195
Naming inconsitency: TcpHeader::GetDestinationPort vs UdpHeader::GetDestination
Last modified: 2008-07-01 13:32:33 UTC
We have TcpHeader::GetDestinationPort to get the port number in TCP, but UdpHeader::GetDestination for UDP. Can we get rid of the inconsistency?
Yes, do you have a preference for which way to go? That is, do we rename the TcpHeader APIs to match the UdpHeader ones, or vice versa?
My personal preference would be GetDestinationPort instead of just GetDestination.
Agree. To me GetDestination makes me think of a destination address. It's a TCP header, though and so you must be referring to something in there, rather than an address. If you pull out your handy Stevens, you see on the inside cover that it must be referring to the source port number and destination port number (in his words). Same story for UDP. GetDestinationPort and GetSourcePort for TCP and UDP seem perfect.
Created attachment 155 [details] Refactor the udp-header naming for consistency with tcp-header This bug is about GetDestination, but for consistency, we should change the names of SetDestination, GetSource, and SetSource as well. This patch does so. Okay to push?
(In reply to comment #4) > Created an attachment (id=155) [edit] > Refactor the udp-header naming for consistency with tcp-header > > This bug is about GetDestination, but for consistency, we should change the > names of SetDestination, GetSource, and SetSource as well. This patch does so. > Okay to push? looks good to me.
OK
changeset: 3b24ac252fba