|
Bugzilla – Full Text Bug Listing |
| Summary: | provide char pointer-based API extension to socket | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
| Component: | internet | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | raj.b |
| Priority: | P3 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
Patch to add uint8_t* based Send API to all sockets
Patch to add uint8_t* based Send API to all sockets (update 1) Patch to add uint8_t* based Send API to all sockets (update 2, final) |
||
|
Description
Tom Henderson
2007-12-05 02:15:08 UTC
Created attachment 93 [details]
Patch to add uint8_t* based Send API to all sockets
This is a simple non-virtual public API in the socket base class that creates a Packet with the contents of a uint8_t* style buffer, the forwards this along to the pure virtual Send(Packet p).
(In reply to comment #1) > Created an attachment (id=93) [edit] > Patch to add uint8_t* based Send API to all sockets > > This is a simple non-virtual public API in the socket base class that creates a > Packet with the contents of a uint8_t* style buffer, the forwards this along to > the pure virtual Send(Packet p). I thought you wanted to support the idiom of calling the Send method with a zero pointer: maybe you should add the necessary if statement to the Send method ? Also, it would be nice to add the necessary doxygen to this new method which documents the bahavior in case the pointer is zero and/or the size is zero. Created attachment 94 [details]
Patch to add uint8_t* based Send API to all sockets (update 1)
Additions:
* Doxygen and support for dummy data sending on buf=0 calls
* SendTo(Address&, uint8_t*, uint32_t).
Comments:
I didn't document what happens when size=0 because I'm not sure. It comes down to what the behavior of Buffer::AddAtStart(0) is. I didn't try too hard to understand the Buffer implementation...I'm hoping Mathieu could answer about the behavior of this call.
(In reply to comment #3) > I didn't document what happens when size=0 because I'm not sure. It comes down > to what the behavior of Buffer::AddAtStart(0) is. I didn't try too hard to > understand the Buffer implementation...I'm hoping Mathieu could answer about > the behavior of this call. It should not do anything. this patch seems fine to commit now (TCP will depend on this) except that it should align with the coding std that has space between function name and first parenthesis Created attachment 97 [details]
Patch to add uint8_t* based Send API to all sockets (update 2, final)
I've made cosmetic changes to spacing for alignment with the coding style. I'll merge this into ns-3-dev after 5:00 PM EST unless there further comments.
Closing out bug (patch pushed). |