Bug 195 - Naming inconsitency: TcpHeader::GetDestinationPort vs UdpHeader::GetDestination
Naming inconsitency: TcpHeader::GetDestinationPort vs UdpHeader::GetDestination
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
pre-release
All All
: P1 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-30 06:17 UTC by Gustavo J. A. M. Carneiro
Modified: 2008-07-01 13:32 UTC (History)
0 users

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2008-05-30 06:17:22 UTC
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 Rajib Bhattacharjea 2008-05-30 15:15:31 UTC
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 Gustavo J. A. M. Carneiro 2008-05-30 17:09:38 UTC
My personal preference would be GetDestinationPort instead of just GetDestination.
Comment 3 Craig Dowell 2008-05-30 17:19:26 UTC
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 Rajib Bhattacharjea 2008-06-06 13:03:53 UTC
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?
Comment 5 Mathieu Lacage 2008-06-06 13:06:22 UTC
(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.
Comment 6 Tom Henderson 2008-06-06 13:25:45 UTC
OK
Comment 7 Mathieu Lacage 2008-06-06 14:42:21 UTC
changeset: 3b24ac252fba