Re: [tkined] problem: binary data and the udp send

From: Erik Schoenfelder (schoenfr@gaertner.de)
Date: Thu Apr 27 2000 - 11:18:49 MET DST


Hi,

Dmitry> It seems like Tnm udp command cuts messages at zero value.

Dmitry> Here is my code:

Dmitry> set msg [binary format H2H2H2 01 00 01]
Dmitry> set broadcast [udp open 68]
Dmitry> udp send $broadcast 195.222.130.75 67 $msg

Dmitry> Using tcpdump I found that only first byte (01) is sent to network:

Dmitry> tcpdump -s 600 -x -l src 192.168.1.1 and udp port 68

Dmitry> 17:00:23.061397 myhost.bootpc > ourrouter.bootps: [|bootp]
Dmitry> 4500 001d e6bc 0000 4011 07c5 c3de 8246
Dmitry> c3de 824b 0044 0043 0009 7206 01
Dmitry> ^^^ there is no
Dmitry> 00 01 here

Dmitry> My Tcl is 8.0.3 on Linux. Scotty is last 3.0.0 snapshot. I
Dmitry> checked for possible problem in "binary" command - it looks to
Dmitry> be OK.

sorry, but you are right: the data are truncated at the 0-bute.

the Tnm::udp send command simply expects a zero-byte delimited string,
not a binary object:

> len = TnmSocketSendTo(usock->sock, argv[5], strlen(argv[5]), 0,
> (struct sockaddr *) &name, sizeof(name));

so it cannot be used for binary data.

i'm not sure, but Juergen planned to rewrite some parts of scotty to
use tcl-objects. maybe udp is part of this and may solve this. but
this is speculation.

                                                        Erik

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:42 MET