Bug 508 - [contribution] udp-echo-client modifications
[contribution] udp-echo-client modifications
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
ns-3-dev
All All
: P5 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-23 00:56 EST by Tom Henderson
Modified: 2009-06-23 22:49 EDT (History)
1 user (show)

See Also:


Attachments
.cc file (5.43 KB, text/x-c++src)
2009-02-23 00:57 EST, Tom Henderson
Details
.h file (1.82 KB, text/plain)
2009-02-23 00:57 EST, Tom Henderson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2009-02-23 00:56:47 EST
(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
Comment 1 Tom Henderson 2009-02-23 00:57:13 EST
Created attachment 384 [details]
.cc file
Comment 2 Tom Henderson 2009-02-23 00:57:36 EST
Created attachment 385 [details]
.h file
Comment 3 Craig Dowell 2009-06-23 22:49:12 EDT
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