All, Not usual my intervention on this forum. Anyhow ... Just to remind that OCTET STRING is generally wrongly assumed to be a vehicle for ASCii character strings, whereas this is an ASN.1 primitive type simply carrying an array of bytes. One need to define a textual convention and display hints in order to transform an OCTET STRING into TEXT (and use the %s formatting). Take a look at SNMP SMI-v2 RFC-2579 for some examples of this : for instance, the very frequent DisplayString type is a textual convention for NVT characters, based on OCTET STRING, and where the NUL has no special meaning : in particular, it is not marking the end of the character string ! Another one is DateAndTime.
Hope this helps you avoiding a, so much frequent, trap ... Robert -----Message d'origine----- De : tsp-devel-bounces+robert.pagnot=astrium.eads....@nongnu.org [mailto:tsp-devel-bounces+robert.pagnot=astrium.eads....@nongnu.org] De la part de Eric Noulard Envoyé : lundi 15 mars 2010 12:26 À : Transport Sample Protocol development list Objet : Re: [Tsp-devel] Octet string and 0 char 2010/3/15 Yves DUF <yves....@laposte.net>: > Hi > > 2010/3/11 <yves.cere...@thalesaleniaspace.com> >> >> Hello >> >> We have a problem using Dadi TSP 0.8.3 and acessing a MIB to get Octet >> string value : > > What do you mean with Dadi, I don't understand the word. Maybe I've spend > too many time outside TSP. Yes man. DADI (DAta DIsptacher) is easy to use Blackboard-based data dispatcher initially writtend by Fred Deweerdt. It makes it easy to create a SNMP agent from a TSP blackboard enabled applications. I think Jérôme (ARBEZ-GINDRE) should be in charge now. >> The value charcter table contains '0' characters, and as Dadi >> implementation uses strcpy/strlen for getting values, we only get first part >> of data. >> Is there any patch/evolution in progress solving this problem ? > > If I look on TSP buglist, I don't see any bugs similar, except maybe this > one http://savannah.nongnu.org/bugs/?26304 > But as far as I can see, it's still not closed. > So I'm afraid you might need to fix that bug yourself, and send the patch to > TSP-devel. First of all you may try to dig a little in order to check whether if the bug is at BlackBoard layer or at upper-level DADI or anything in between. I'm hoping Fred or Jérôme are listening here because they should have more knowledge in this area. And as a last resort, try t fix and submit a patch I'll try to integrate it. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org _______________________________________________ Tsp-devel mailing list Tsp-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tsp-devel Ce courriel (incluant ses eventuelles pieces jointes) peut contenir des informations confidentielles et/ou protegees ou dont la diffusion est restreinte. Si vous avez recu ce courriel par erreur, vous ne devez ni le copier, ni l'utiliser, ni en divulguer le contenu a quiconque. Merci d'en avertir immediatement l'expediteur et d'effacer ce courriel de votre systeme. Astrium decline toute responsabilite en cas de corruption par virus, d'alteration ou de falsification de ce courriel lors de sa transmission par voie electronique. This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments and do not use it for any purpose or disclose its content to any person, but delete this message and any attachments from your system. Astrium disclaims any and all liability if this email transmission was virus corrupted, altered or falsified. --------------------------------------------------------------------- Astrium SAS (393 341 516 RCS Paris) - Siege social: 6 rue Laurent Pichat, 75016 Paris, France _______________________________________________ Tsp-devel mailing list Tsp-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tsp-devel