You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Sherman Lilly <sh...@gmail.com> on 2015/12/15 16:40:22 UTC

DHCPOption problem

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?

Sherman

Re: DHCPOption problem

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 15/12/15 19:18, Sherman Lilly a écrit :
> Can I do it with Apache Directory Studio

Yes. You can associate the dhcpOption Attribute to an editor that allows
you to set its value. Check in the Preferences.


Re: DHCPOption problem

Posted by Sherman Lilly <sh...@gmail.com>.
Can I do it with Apache Directory Studio
On Dec 15, 2015 11:29 AM, "Emmanuel Lécharny" <el...@gmail.com> wrote:

> 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 )
>
>
>

Re: DHCPOption problem

Posted by Emmanuel Lécharny <el...@gmail.com>.
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 )