| 1 |
/* |
|---|
| 2 |
* wsman-transport.i |
|---|
| 3 |
* client transport declarations for openwsman swig bindings |
|---|
| 4 |
* |
|---|
| 5 |
*/ |
|---|
| 6 |
|
|---|
| 7 |
%rename(Transport) _WsManTransport; |
|---|
| 8 |
%nodefault _WsManTransport; |
|---|
| 9 |
typedef struct _WsManTransport {} WsManTransport; |
|---|
| 10 |
|
|---|
| 11 |
/* |
|---|
| 12 |
* Transport is no separate struct in openwsman but part of WsManClient |
|---|
| 13 |
* |
|---|
| 14 |
* However, accessing transport in e.g. Ruby as |
|---|
| 15 |
* client.transport_<foo> |
|---|
| 16 |
* is cumbersome |
|---|
| 17 |
* |
|---|
| 18 |
* Instead we provide |
|---|
| 19 |
* t = client.transport |
|---|
| 20 |
* t.<foo> |
|---|
| 21 |
* as a convenience |
|---|
| 22 |
* |
|---|
| 23 |
*/ |
|---|
| 24 |
%extend WsManTransport { |
|---|
| 25 |
|
|---|
| 26 |
%constant int NO_AUTH = WS_NO_AUTH; |
|---|
| 27 |
%constant int BASIC_AUTH = WS_BASIC_AUTH; |
|---|
| 28 |
%constant int DIGEST_AUTH = WS_DIGEST_AUTH; |
|---|
| 29 |
%constant int PASS_AUTH = WS_PASS_AUTH; |
|---|
| 30 |
%constant int NTLM_AUTH = WS_NTLM_AUTH; |
|---|
| 31 |
%constant int GSSNEGOTIATE_AUTH = WS_GSSNEGOTIATE_AUTH; |
|---|
| 32 |
|
|---|
| 33 |
%constant char *NO_AUTH_STR = _WS_NO_AUTH; |
|---|
| 34 |
%constant char *BASIC_AUTH_STR = _WS_BASIC_AUTH; |
|---|
| 35 |
%constant char *DIGEST_AUTH_STR = _WS_DIGEST_AUTH; |
|---|
| 36 |
%constant char *NTLM_AUTH_STR = _WS_NTLM_AUTH; |
|---|
| 37 |
%constant char *GSSNEGOTIATE_AUTH_STR = _WS_GSSNEGOTIATE_AUTH; |
|---|
| 38 |
|
|---|
| 39 |
#if defined(SWIGRUBY) |
|---|
| 40 |
%rename("auth_method?") is_auth_method(int method); |
|---|
| 41 |
#endif |
|---|
| 42 |
int is_auth_method(int method) { |
|---|
| 43 |
return wsman_is_auth_method((WsManClient *)$self, method); |
|---|
| 44 |
} |
|---|
| 45 |
|
|---|
| 46 |
void close() { |
|---|
| 47 |
wsman_transport_close_transport((WsManClient *)$self); |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
#if defined(SWIGRUBY) |
|---|
| 51 |
%rename("agent=") set_agent(const char *agent); |
|---|
| 52 |
#endif |
|---|
| 53 |
void set_agent(const char *agent) { |
|---|
| 54 |
wsman_transport_set_agent((WsManClient *)$self, agent); |
|---|
| 55 |
} |
|---|
| 56 |
char *agent() { |
|---|
| 57 |
return wsman_transport_get_agent ((WsManClient *)$self); |
|---|
| 58 |
} |
|---|
| 59 |
|
|---|
| 60 |
#if defined(SWIGRUBY) |
|---|
| 61 |
%rename("username=") set_username(char *user_name); |
|---|
| 62 |
#endif |
|---|
| 63 |
void set_username(char *user_name) { |
|---|
| 64 |
wsman_transport_set_userName((WsManClient *)$self, user_name); |
|---|
| 65 |
} |
|---|
| 66 |
|
|---|
| 67 |
#if defined(SWIGRUBY) |
|---|
| 68 |
%rename("password=") set_password(char *password); |
|---|
| 69 |
#endif |
|---|
| 70 |
void set_password(char *password) { |
|---|
| 71 |
wsman_transport_set_password((WsManClient *)$self, password); |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
#if defined(SWIGRUBY) |
|---|
| 75 |
%rename("proxy_username=") set_proxy_username(char *proxy_username); |
|---|
| 76 |
#endif |
|---|
| 77 |
void set_proxy_username(char *proxy_username) { |
|---|
| 78 |
wsman_transport_set_proxy_username((WsManClient *)$self, proxy_username ); |
|---|
| 79 |
} |
|---|
| 80 |
|
|---|
| 81 |
#if defined(SWIGRUBY) |
|---|
| 82 |
%rename("proxy_password=") set_proxy_password(char *proxy_password); |
|---|
| 83 |
#endif |
|---|
| 84 |
void set_proxy_password(char *proxy_password) { |
|---|
| 85 |
wsman_transport_set_proxy_password((WsManClient *)$self, proxy_password ); |
|---|
| 86 |
} |
|---|
| 87 |
|
|---|
| 88 |
#if defined(SWIGRUBY) |
|---|
| 89 |
%rename("auth_method=") set_auth_method( const char *am); |
|---|
| 90 |
#endif |
|---|
| 91 |
void set_auth_method( const char *am) { |
|---|
| 92 |
wsman_transport_set_auth_method((WsManClient *)$self, am); |
|---|
| 93 |
} |
|---|
| 94 |
char *auth_method() { |
|---|
| 95 |
return wsman_transport_get_auth_method ((WsManClient *)$self); |
|---|
| 96 |
} |
|---|
| 97 |
|
|---|
| 98 |
static char *auth_name(int auth) { |
|---|
| 99 |
return wsmc_transport_get_auth_name(auth); |
|---|
| 100 |
} |
|---|
| 101 |
int auth_value() { |
|---|
| 102 |
return wsmc_transport_get_auth_value((WsManClient *)$self); |
|---|
| 103 |
} |
|---|
| 104 |
static char *error_string(int err) { |
|---|
| 105 |
return wsman_transport_get_last_error_string(err); |
|---|
| 106 |
} |
|---|
| 107 |
|
|---|
| 108 |
#if defined(SWIGRUBY) |
|---|
| 109 |
%rename("timeout=") set_timeout(unsigned long timeout); |
|---|
| 110 |
#endif |
|---|
| 111 |
void set_timeout(unsigned long timeout) { |
|---|
| 112 |
wsman_transport_set_timeout((WsManClient *)$self, timeout); |
|---|
| 113 |
} |
|---|
| 114 |
unsigned long timeout() { |
|---|
| 115 |
return wsman_transport_get_timeout((WsManClient *)$self); |
|---|
| 116 |
} |
|---|
| 117 |
|
|---|
| 118 |
#if defined(SWIGRUBY) |
|---|
| 119 |
%rename("verify_peer=") set_verify_peer( unsigned int value ); |
|---|
| 120 |
#endif |
|---|
| 121 |
void set_verify_peer( unsigned int value ) { |
|---|
| 122 |
wsman_transport_set_verify_peer((WsManClient *)$self, value); |
|---|
| 123 |
} |
|---|
| 124 |
unsigned int verify_peer() { |
|---|
| 125 |
return wsman_transport_get_verify_peer((WsManClient *)$self); |
|---|
| 126 |
} |
|---|
| 127 |
|
|---|
| 128 |
#if defined(SWIGRUBY) |
|---|
| 129 |
%rename("verify_host=") set_verify_host(unsigned int value); |
|---|
| 130 |
#endif |
|---|
| 131 |
void set_verify_host(unsigned int value) { |
|---|
| 132 |
wsman_transport_set_verify_host((WsManClient *)$self, value); |
|---|
| 133 |
} |
|---|
| 134 |
unsigned int verify_host() { |
|---|
| 135 |
return wsman_transport_get_verify_host((WsManClient *)$self); |
|---|
| 136 |
} |
|---|
| 137 |
|
|---|
| 138 |
#if defined(SWIGRUBY) |
|---|
| 139 |
%rename("proxy=") set_proxy(const char *proxy); |
|---|
| 140 |
#endif |
|---|
| 141 |
void set_proxy(const char *proxy) { |
|---|
| 142 |
wsman_transport_set_proxy((WsManClient *)$self, proxy); |
|---|
| 143 |
} |
|---|
| 144 |
char *proxy() { |
|---|
| 145 |
return wsman_transport_get_proxy((WsManClient *)$self); |
|---|
| 146 |
} |
|---|
| 147 |
|
|---|
| 148 |
#if defined(SWIGRUBY) |
|---|
| 149 |
%rename("proxyauth=") set_proxyauth(const char *pauth); |
|---|
| 150 |
#endif |
|---|
| 151 |
void set_proxyauth(const char *pauth) { |
|---|
| 152 |
wsman_transport_set_proxyauth((WsManClient *)$self, pauth); |
|---|
| 153 |
} |
|---|
| 154 |
char *proxyauth(){ |
|---|
| 155 |
return wsman_transport_get_proxyauth((WsManClient *)$self); |
|---|
| 156 |
} |
|---|
| 157 |
|
|---|
| 158 |
#if defined(SWIGRUBY) |
|---|
| 159 |
%rename("cainfo=") set_cainfo(const char *cainfo); |
|---|
| 160 |
#endif |
|---|
| 161 |
void set_cainfo(const char *cainfo) { |
|---|
| 162 |
wsman_transport_set_cainfo((WsManClient *)$self, cainfo); |
|---|
| 163 |
} |
|---|
| 164 |
char *cainfo() { |
|---|
| 165 |
return wsman_transport_get_cainfo((WsManClient *)$self); |
|---|
| 166 |
} |
|---|
| 167 |
|
|---|
| 168 |
#if defined(SWIGRUBY) |
|---|
| 169 |
%rename("certhumbprint=") set_certhumbprint(const char *arg); |
|---|
| 170 |
#endif |
|---|
| 171 |
void set_certhumbprint(const char *arg) { |
|---|
| 172 |
wsman_transport_set_certhumbprint((WsManClient *)$self, arg); |
|---|
| 173 |
} |
|---|
| 174 |
char *certhumbprint() { |
|---|
| 175 |
return wsman_transport_get_certhumbprint((WsManClient *)$self); |
|---|
| 176 |
} |
|---|
| 177 |
|
|---|
| 178 |
#if defined(SWIGRUBY) |
|---|
| 179 |
%rename("capath=") set_capath(const char *capath); |
|---|
| 180 |
#endif |
|---|
| 181 |
void set_capath(const char *capath) { |
|---|
| 182 |
wsman_transport_set_capath((WsManClient *)$self, capath); |
|---|
| 183 |
} |
|---|
| 184 |
char *capath() { |
|---|
| 185 |
return wsman_transport_get_capath((WsManClient *)$self); |
|---|
| 186 |
} |
|---|
| 187 |
|
|---|
| 188 |
#if defined(SWIGRUBY) |
|---|
| 189 |
%rename("caoid=") set_caoid(const char *oid); |
|---|
| 190 |
#endif |
|---|
| 191 |
void set_caoid(const char *oid) { |
|---|
| 192 |
wsman_transport_set_caoid((WsManClient *)$self, oid); |
|---|
| 193 |
} |
|---|
| 194 |
char *caoid() { |
|---|
| 195 |
return wsman_transport_get_caoid((WsManClient *)$self); |
|---|
| 196 |
} |
|---|
| 197 |
|
|---|
| 198 |
#ifdef _WIN32 |
|---|
| 199 |
#if defined(SWIGRUBY) |
|---|
| 200 |
%rename("calocal=") set_calocal(BOOL local); |
|---|
| 201 |
#endif |
|---|
| 202 |
void set_calocal(BOOL local) { |
|---|
| 203 |
wsman_transport_set_calocal((WsManClient *)$self, local); |
|---|
| 204 |
} |
|---|
| 205 |
BOOL calocal() { |
|---|
| 206 |
return wsman_transport_get_calocal((WsManClient *)$self); |
|---|
| 207 |
} |
|---|
| 208 |
#endif |
|---|
| 209 |
|
|---|
| 210 |
#if defined(SWIGRUBY) |
|---|
| 211 |
%rename("cert=") set_cert(const char *cert); |
|---|
| 212 |
#endif |
|---|
| 213 |
void set_cert(const char *cert) { |
|---|
| 214 |
wsman_transport_set_cert((WsManClient *)$self, cert); |
|---|
| 215 |
} |
|---|
| 216 |
const char *cert() { |
|---|
| 217 |
return wsman_transport_get_cert((WsManClient *)$self); |
|---|
| 218 |
} |
|---|
| 219 |
|
|---|
| 220 |
#if defined(SWIGRUBY) |
|---|
| 221 |
%rename("key=") set_key(const char *key); |
|---|
| 222 |
#endif |
|---|
| 223 |
void set_key(const char *key) { |
|---|
| 224 |
wsman_transport_set_key((WsManClient *)$self, key); |
|---|
| 225 |
} |
|---|
| 226 |
char *key() { |
|---|
| 227 |
return wsman_transport_get_key((WsManClient *)$self); |
|---|
| 228 |
} |
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
} |
|---|