directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: DHCPOption problem
Date Tue, 15 Dec 2015 16:29:36 GMT
Le 15/12/15 16:40, Sherman Lilly a écrit :
> I am trying to Apache Directory server for a DHCP backend. I have got a lot
> of it working but I have hit wall and need help. I am trying to add an
> attribute the "dhcpOption". When I try to add it, it ask for a binary value
> but I don't how to add it. Let us say that I am trying to add "dhcpOption"
> with a value of "broadcast 10.50.255.255". That is a string and will not
> work. After lots of research apparently the value needed for that attribute
> has to an encoded value of the string. How do I make this encoded value?

It depends on the tool you are using.

Basically, if you are using Java, you need to get the UTF-8 form for the
String you want to inject into the server. That's done with :

"Your data".getBytes( StandardCharsets.UTF_8 );

You can also use the Apache LDAP API
org.apache.directory.api.util.Strings method :
   public static byte[] getBytesUtf8( String string )



Mime
View raw message