Bug 195 - Naming inconsitency: TcpHeader::GetDestinationPort vs UdpHeader::GetDestination
: Naming inconsitency: TcpHeader::GetDestinationPort vs UdpHeader::GetDestination
Status: RESOLVED FIXED
: ns-3
internet-stack
: pre-release
: All All
: P1 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-05-30 06:17 EDT by
Modified: 2008-07-01 13:32 EDT (History)


Attachments
Refactor the udp-header naming for consistency with tcp-header (2.94 KB, patch)
2008-06-06 13:03 EDT, Rajib Bhattacharjea
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-05-30 06:17:22 EDT
We have TcpHeader::GetDestinationPort to get the port number in TCP, but
UdpHeader::GetDestination for UDP.  Can we get rid of the inconsistency?
------- Comment #1 From 2008-05-30 15:15:31 EDT -------
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?
------- Comment #2 From 2008-05-30 17:09:38 EDT -------
My personal preference would be GetDestinationPort instead of just
GetDestination.
------- Comment #3 From 2008-05-30 17:19:26 EDT -------
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.
------- Comment #4 From 2008-06-06 13:03:53 EDT -------
Created an attachment (id=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?
------- Comment #5 From 2008-06-06 13:06:22 EDT -------
(In reply to comment #4)
> Created an attachment (id=155) [edit] [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?


looks good to me.
------- Comment #6 From 2008-06-06 13:25:45 EDT -------
OK
------- Comment #7 From 2008-06-06 14:42:21 EDT -------
changeset: 3b24ac252fba