|
Bugzilla – Full Text Bug Listing |
| Summary: | [contribution] udp-echo-client modifications | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
| Component: | applications | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | craigdo |
| Priority: | P5 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
.cc file
.h file |
||
Created attachment 384 [details]
.cc file
Created attachment 385 [details]
.h file
changeset: 84c133267507
There were some issues with buffer overflows and consistency problems, so I massaged this a bit and added some capabilities.
See udp-echo.cc example for user visible API:
UdpEchoClientHelper client (i.GetAddress (1), port);
...
#if 0
//
// Users may find it convenient to initialize echo packets with actual data;
// the below lines suggest how to do this
//
client.SetFill(apps.Get (0), "Hello World");
client.SetFill(apps.Get (0), 0xa5, 1024);
uint8_t fill[] = {0, 1, 2, 3, 4, 5, 6};
client.SetFill(apps.Get (0), fill, sizeof(fill), 1024);
#endif
|
(from ns-developers post, Feb. 6 2009) Hi all, We've made some modifications to the udp-echo-client application to be able to add a text string as data in the packets. A example of use will be in the definition of the echoClient, adding: echoClient.SetAttribute ("MaxPackets", UintegerValue (1)); echoClient.SetAttribute ("Interval", TimeValue (Seconds (5.))); echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); echoClient.SetAttribute ("PacketData", StringValue("Hello world"); Regards, CITIC