Some help with ffi

So,

  I'm having a weird issue with ffi (most likely because my lack of

knowledge in ‘C’).

  The code is here: [https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-the_ruby_code-rb](https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-the_ruby_code-rb)

  A C code  reference is here: [https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-th_c_code-c](https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-th_c_code-c)

  And my error is here: [https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-my_error-sh](https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-my_error-sh)

  Overall it looks like what ffi is sending to the C wrapper is not

what the C wrapper expects ? or something…

  Thanks,

···


**Safe-T.com

            Bar Hofesh**

SSH_BIND_OPTIONS_DSAKEY etc aren't strings - they're enums, so at the
function call level they're just integers. Somewhere in a header file will
be a definition of what value SSH_BIND_OPTIONS_DSAKEY is (at a quick
glance, here: http://api.libssh.org/stable/server_8h_source.html\)

Fred

···

On Mon, Nov 24, 2014 at 10:19 AM, Bar Hofesh <bar.hofesh@safe-t.com> wrote:

So,

I'm having a weird issue with ffi (most likely because my lack of
knowledge in 'C').

The code is here:
https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-the_ruby_code-rb
A C code reference is here:
https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-th_c_code-c
And my error is here:
https://gist.github.com/bararchy/c79be78a82c64eb6df41#file-my_error-sh

Overall it looks like what ffi is sending to the C wrapper is not what the
C wrapper expects ? or something...

Thanks,
--

*[image: Safe-T.com] Bar Hofesh*