@@ -1386,30 +1386,42 @@ function ssh_options_parse_config(session, filename)
1386
1386
end
1387
1387
1388
1388
"""
1389
- ssh_options_set(session, type, value)
1389
+ ssh_options_set(session, type, value; throw = true )
1390
1390
1391
- [Upstream documentation ](https://api.libssh.org/stable/group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d).
1391
+ Auto-generated wrapper around [`ssh_options_set` ](https://api.libssh.org/stable/group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d).
1392
1392
"""
1393
- function ssh_options_set (session, type, value)
1394
- @ccall libssh. ssh_options_set (session:: ssh_session , type:: ssh_options_e , value:: Ptr{Cvoid} ):: Cint
1393
+ function ssh_options_set (session, type, value; throw = true )
1394
+ ret = @ccall (libssh. ssh_options_set (session:: ssh_session , type:: ssh_options_e , value:: Ptr{Cvoid} ):: Cint )
1395
+ if ret != SSH_OK && throw
1396
+ Base. throw (LibSSHException (" Error from ssh_options_set, did not return SSH_OK: " * " $(ret) " ))
1397
+ end
1398
+ return ret
1395
1399
end
1396
1400
1397
1401
"""
1398
- ssh_options_get(session, type, value)
1402
+ ssh_options_get(session, type, value; throw = true )
1399
1403
1400
- [Upstream documentation ](https://api.libssh.org/stable/group__libssh__session.html#gaaa9d400920cad4d6e4a0fb09ff8c7b01).
1404
+ Auto-generated wrapper around [`ssh_options_get` ](https://api.libssh.org/stable/group__libssh__session.html#gaaa9d400920cad4d6e4a0fb09ff8c7b01).
1401
1405
"""
1402
- function ssh_options_get (session, type, value)
1403
- @ccall libssh. ssh_options_get (session:: ssh_session , type:: ssh_options_e , value:: Ptr{Ptr{Cchar}} ):: Cint
1406
+ function ssh_options_get (session, type, value; throw = true )
1407
+ ret = @ccall (libssh. ssh_options_get (session:: ssh_session , type:: ssh_options_e , value:: Ptr{Ptr{Cchar}} ):: Cint )
1408
+ if ret != SSH_OK && throw
1409
+ Base. throw (LibSSHException (" Error from ssh_options_get, did not return SSH_OK: " * " $(ret) " ))
1410
+ end
1411
+ return ret
1404
1412
end
1405
1413
1406
1414
"""
1407
- ssh_options_get_port(session, port_target)
1415
+ ssh_options_get_port(session, port_target; throw = true )
1408
1416
1409
- [Upstream documentation ](https://api.libssh.org/stable/group__libssh__session.html#gaa298d8445355420d80f2d968477ba86f).
1417
+ Auto-generated wrapper around [`ssh_options_get_port` ](https://api.libssh.org/stable/group__libssh__session.html#gaa298d8445355420d80f2d968477ba86f).
1410
1418
"""
1411
- function ssh_options_get_port (session, port_target)
1412
- @ccall libssh. ssh_options_get_port (session:: ssh_session , port_target:: Ptr{Cuint} ):: Cint
1419
+ function ssh_options_get_port (session, port_target; throw = true )
1420
+ ret = @ccall (libssh. ssh_options_get_port (session:: ssh_session , port_target:: Ptr{Cuint} ):: Cint )
1421
+ if ret != SSH_OK && throw
1422
+ Base. throw (LibSSHException (" Error from ssh_options_get_port, did not return SSH_OK: " * " $(ret) " ))
1423
+ end
1424
+ return ret
1413
1425
end
1414
1426
1415
1427
function ssh_pcap_file_close (pcap)
@@ -1862,17 +1874,20 @@ function ssh_userauth_kbdint_getinstruction(session)
1862
1874
end
1863
1875
1864
1876
"""
1865
- userauth_kbdint_getname (session)::String
1877
+ ssh_userauth_kbdint_getname (session; throw = true)
1866
1878
1867
1879
Auto-generated wrapper around [`ssh_userauth_kbdint_getname`](https://api.libssh.org/stable/group__libssh__auth.html#ga5d6f5eb0ed09fe2c7a2ac69b972e130e).
1868
1880
"""
1869
- function userauth_kbdint_getname (session) :: String
1881
+ function ssh_userauth_kbdint_getname (session; throw = true )
1870
1882
ret = @ccall (libssh. ssh_userauth_kbdint_getname (session:: ssh_session ):: Ptr{Cchar} )
1871
1883
if ret == C_NULL
1872
- throw (LibSSHException (" Error from ssh_userauth_kbdint_getname, no string found (returned C_NULL)" ))
1873
- else
1874
- return unsafe_string (Ptr {UInt8} (ret))
1884
+ if throw
1885
+ Base. throw (LibSSHException (" Error from ssh_userauth_kbdint_getname, no string found (returned C_NULL)" ))
1886
+ else
1887
+ return ret
1888
+ end
1875
1889
end
1890
+ return unsafe_string (Ptr {UInt8} (ret))
1876
1891
end
1877
1892
1878
1893
"""
@@ -1885,17 +1900,20 @@ function ssh_userauth_kbdint_getnprompts(session)
1885
1900
end
1886
1901
1887
1902
"""
1888
- userauth_kbdint_getprompt (session, i, echo)::String
1903
+ ssh_userauth_kbdint_getprompt (session, i, echo; throw = true)
1889
1904
1890
1905
Auto-generated wrapper around [`ssh_userauth_kbdint_getprompt`](https://api.libssh.org/stable/group__libssh__auth.html#ga15c0f954f79d73e1ac5981ac483efb75).
1891
1906
"""
1892
- function userauth_kbdint_getprompt (session, i, echo) :: String
1907
+ function ssh_userauth_kbdint_getprompt (session, i, echo; throw = true )
1893
1908
ret = @ccall (libssh. ssh_userauth_kbdint_getprompt (session:: ssh_session , i:: Cuint , echo:: Ptr{Cchar} ):: Ptr{Cchar} )
1894
1909
if ret == C_NULL
1895
- throw (LibSSHException (" Error from ssh_userauth_kbdint_getprompt, no string found (returned C_NULL)" ))
1896
- else
1897
- return unsafe_string (Ptr {UInt8} (ret))
1910
+ if throw
1911
+ Base. throw (LibSSHException (" Error from ssh_userauth_kbdint_getprompt, no string found (returned C_NULL)" ))
1912
+ else
1913
+ return ret
1914
+ end
1898
1915
end
1916
+ return unsafe_string (Ptr {UInt8} (ret))
1899
1917
end
1900
1918
1901
1919
"""
@@ -1908,17 +1926,20 @@ function ssh_userauth_kbdint_getnanswers(session)
1908
1926
end
1909
1927
1910
1928
"""
1911
- userauth_kbdint_getanswer (session, i)::String
1929
+ ssh_userauth_kbdint_getanswer (session, i; throw = true)
1912
1930
1913
1931
Auto-generated wrapper around [`ssh_userauth_kbdint_getanswer`](https://api.libssh.org/stable/group__libssh__auth.html#ga4f55ed8bc6f553423ab1c92598d0194b).
1914
1932
"""
1915
- function userauth_kbdint_getanswer (session, i) :: String
1933
+ function ssh_userauth_kbdint_getanswer (session, i; throw = true )
1916
1934
ret = @ccall (libssh. ssh_userauth_kbdint_getanswer (session:: ssh_session , i:: Cuint ):: Ptr{Cchar} )
1917
1935
if ret == C_NULL
1918
- throw (LibSSHException (" Error from ssh_userauth_kbdint_getanswer, no string found (returned C_NULL)" ))
1919
- else
1920
- return unsafe_string (Ptr {UInt8} (ret))
1936
+ if throw
1937
+ Base. throw (LibSSHException (" Error from ssh_userauth_kbdint_getanswer, no string found (returned C_NULL)" ))
1938
+ else
1939
+ return ret
1940
+ end
1921
1941
end
1942
+ return unsafe_string (Ptr {UInt8} (ret))
1922
1943
end
1923
1944
1924
1945
"""
@@ -3847,7 +3868,7 @@ function ssh_send_issue_banner(session, banner)
3847
3868
end
3848
3869
3849
3870
"""
3850
- message_reply_default (msg)
3871
+ ssh_message_reply_default (msg; throw = true )
3851
3872
3852
3873
Auto-generated wrapper around `ssh_message_reply_default`. Original upstream documentation is below.
3853
3874
@@ -3864,15 +3885,16 @@ Use this function if you don't know what to respond or if you want to reject a r
3864
3885
# See also
3865
3886
[`ssh_message_get`](@ref)()
3866
3887
"""
3867
- function message_reply_default (msg)
3888
+ function ssh_message_reply_default (msg; throw = true )
3868
3889
ret = @ccall (libssh. ssh_message_reply_default (msg:: ssh_message ):: Cint )
3869
- if ret != SSH_OK
3870
- throw (LibSSHException (" Error from ssh_message_reply_default, did not return SSH_OK: " * " $(ret) " ))
3890
+ if ret != SSH_OK && throw
3891
+ Base . throw (LibSSHException (" Error from ssh_message_reply_default, did not return SSH_OK: " * " $(ret) " ))
3871
3892
end
3893
+ return ret
3872
3894
end
3873
3895
3874
3896
"""
3875
- message_auth_user (msg)::String
3897
+ ssh_message_auth_user (msg; throw = true)
3876
3898
3877
3899
Auto-generated wrapper around `ssh_message_auth_user`. Original upstream documentation is below.
3878
3900
@@ -3887,17 +3909,20 @@ The username or NULL if an error occurred.
3887
3909
# See also
3888
3910
[`ssh_message_get`](@ref)(), [`ssh_message_type`](@ref)()
3889
3911
"""
3890
- function message_auth_user (msg) :: String
3912
+ function ssh_message_auth_user (msg; throw = true )
3891
3913
ret = @ccall (libssh. ssh_message_auth_user (msg:: ssh_message ):: Ptr{Cchar} )
3892
3914
if ret == C_NULL
3893
- throw (LibSSHException (" Error from ssh_message_auth_user, no string found (returned C_NULL)" ))
3894
- else
3895
- return unsafe_string (Ptr {UInt8} (ret))
3915
+ if throw
3916
+ Base. throw (LibSSHException (" Error from ssh_message_auth_user, no string found (returned C_NULL)" ))
3917
+ else
3918
+ return ret
3919
+ end
3896
3920
end
3921
+ return unsafe_string (Ptr {UInt8} (ret))
3897
3922
end
3898
3923
3899
3924
"""
3900
- message_auth_password (msg)::String
3925
+ ssh_message_auth_password (msg; throw = true)
3901
3926
3902
3927
Auto-generated wrapper around `ssh_message_auth_password`. Original upstream documentation is below.
3903
3928
@@ -3916,13 +3941,16 @@ The username or NULL if an error occurred.
3916
3941
# See also
3917
3942
[`ssh_message_get`](@ref)(), [`ssh_message_type`](@ref)()
3918
3943
"""
3919
- function message_auth_password (msg) :: String
3944
+ function ssh_message_auth_password (msg; throw = true )
3920
3945
ret = @ccall (libssh. ssh_message_auth_password (msg:: ssh_message ):: Ptr{Cchar} )
3921
3946
if ret == C_NULL
3922
- throw (LibSSHException (" Error from ssh_message_auth_password, no string found (returned C_NULL)" ))
3923
- else
3924
- return unsafe_string (Ptr {UInt8} (ret))
3947
+ if throw
3948
+ Base. throw (LibSSHException (" Error from ssh_message_auth_password, no string found (returned C_NULL)" ))
3949
+ else
3950
+ return ret
3951
+ end
3925
3952
end
3953
+ return unsafe_string (Ptr {UInt8} (ret))
3926
3954
end
3927
3955
3928
3956
"""
@@ -3948,13 +3976,13 @@ function ssh_message_auth_pubkey(msg)
3948
3976
end
3949
3977
3950
3978
"""
3951
- message_auth_kbdint_is_response (msg)::Bool
3979
+ ssh_message_auth_kbdint_is_response (msg; throw = true)
3952
3980
3953
3981
Auto-generated wrapper around [`ssh_message_auth_kbdint_is_response`](https://api.libssh.org/stable/group__libssh__server.html#ga5132c82c49de985e9e10f51f393e52a4).
3954
3982
"""
3955
- function message_auth_kbdint_is_response (msg) :: Bool
3983
+ function ssh_message_auth_kbdint_is_response (msg; throw = true )
3956
3984
ret = @ccall (libssh. ssh_message_auth_kbdint_is_response (msg:: ssh_message ):: Cint )
3957
- return ret == 1
3985
+ return Bool ( ret)
3958
3986
end
3959
3987
3960
3988
"""
@@ -3972,15 +4000,16 @@ function ssh_message_auth_publickey_state(msg)
3972
4000
end
3973
4001
3974
4002
"""
3975
- message_auth_reply_success (msg, partial)
4003
+ ssh_message_auth_reply_success (msg, partial; throw = true )
3976
4004
3977
4005
Auto-generated wrapper around `ssh_message_auth_reply_success`.
3978
4006
"""
3979
- function message_auth_reply_success (msg, partial)
4007
+ function ssh_message_auth_reply_success (msg, partial; throw = true )
3980
4008
ret = @ccall (libssh. ssh_message_auth_reply_success (msg:: ssh_message , partial:: Cint ):: Cint )
3981
- if ret != SSH_OK
3982
- throw (LibSSHException (" Error from ssh_message_auth_reply_success, did not return SSH_OK: " * " $(ret) " ))
4009
+ if ret != SSH_OK && throw
4010
+ Base . throw (LibSSHException (" Error from ssh_message_auth_reply_success, did not return SSH_OK: " * " $(ret) " ))
3983
4011
end
4012
+ return ret
3984
4013
end
3985
4014
3986
4015
"""
@@ -4002,15 +4031,16 @@ function ssh_message_auth_reply_pk_ok_simple(msg)
4002
4031
end
4003
4032
4004
4033
"""
4005
- message_auth_set_methods (msg, methods)
4034
+ ssh_message_auth_set_methods (msg, methods; throw = true )
4006
4035
4007
4036
Auto-generated wrapper around [`ssh_message_auth_set_methods`](https://api.libssh.org/stable/group__libssh__server.html#gab993157d98e5b4b3399d216c9243effc).
4008
4037
"""
4009
- function message_auth_set_methods (msg, methods)
4038
+ function ssh_message_auth_set_methods (msg, methods; throw = true )
4010
4039
ret = @ccall (libssh. ssh_message_auth_set_methods (msg:: ssh_message , methods:: Cint ):: Cint )
4011
- if ret != SSH_OK
4012
- throw (LibSSHException (" Error from ssh_message_auth_set_methods, did not return SSH_OK: " * " $(ret) " ))
4040
+ if ret != SSH_OK && throw
4041
+ Base . throw (LibSSHException (" Error from ssh_message_auth_set_methods, did not return SSH_OK: " * " $(ret) " ))
4013
4042
end
4043
+ return ret
4014
4044
end
4015
4045
4016
4046
"""
0 commit comments