Mehic.info

How to install wkhtmltopdf on shared hosting (Ubuntu)?

First obtain .deb file from http://wkhtmltopdf.org/downloads.html. Be sure that you select proper version for your operation system. Following steps are for Ubuntu 12.04. : Execute: wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-precise-amd64.deb You should have wkhtmltox-0.12.2.1_linux-precise-amd64.deb downloaded in your directory Execute: ar vx wkhtmltox-0.12.2.1_linux-precise-amd64.deb You should now have these folders: debian-binary control.tar.gz data.tar.xz Execute: tar -xvf data.tar.xz You should now have folder […]

Read more

IP ToS fields with UDPSockets – implementation issue

For the purposes of my project, I needed to add TOS tag to UDP packets which are generated by OLSR routing protocol. In olsr-routing-protocol.cc I added ToS Values: // Create a socket to listen only on this interface Ptr socket = Socket::CreateSocket (GetObject (),UdpSocketFactory::GetTypeId ()); socket->SetAllowBroadcast (true); socket->SetIpTos(6); socket->SetIpRecvTos(true); And when I executed the code […]

Read more

Add and read content to Packet payload in NS3

To add content to packet payload you can use following commands: std::ostringstream msg; msg << “Hello World!” << ‘\0’; Ptr<Packet> packet = Create<Packet> ((uint8_t*) msg.str().c_str(), msg.str().length()); To read content from packet payload: uint8_t *buffer = new uint8_t[packet->GetSize ()]; packet->CopyData(buffer, packet->GetSize ()); std::string s = std::string((char*)buffer);

Read more