Alien-uv

 view release on metacpan or  search on metacpan

libuv/docs/src/guide/utilities.rst  view on Meta::CPAN

139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.. code-block:: c
    :linenos:
    :emphasize-lines: 2
 
    struct ftp_baton {
        uv_work_t req;
        char *host;
        int port;
        char *username;
        char *password;
    }
 
.. code-block:: c
    :linenos:
    :emphasize-lines: 2
 
    ftp_baton *baton = (ftp_baton*) malloc(sizeof(ftp_baton));
    baton->req.data = (void*) baton;
    baton->host = strdup("my.webhost.com");
    baton->port = 21;

libuv/docs/src/misc.rst  view on Meta::CPAN

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
                struct sockaddr_in6 address6;
            } address;
            union {
                struct sockaddr_in netmask4;
                struct sockaddr_in6 netmask6;
            } netmask;
        } uv_interface_address_t;
 
.. c:type:: uv_passwd_t
 
    Data type for password file information.
 
    ::
 
        typedef struct uv_passwd_s {
            char* username;
            long uid;
            long gid;
            char* shell;
            char* homedir;
        } uv_passwd_t;

libuv/docs/src/misc.rst  view on Meta::CPAN

430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
    include the terminating null). On `UV_ENOBUFS` failure `size` is set to the
    required length for `buffer`, including the null byte.
 
    .. warning::
        `uv_os_tmpdir()` is not thread safe.
 
    .. versionadded:: 1.9.0
 
.. c:function:: int uv_os_get_passwd(uv_passwd_t* pwd)
 
    Gets a subset of the password file entry for the current effective uid (not
    the real uid). The populated data includes the username, euid, gid, shell,
    and home directory. On non-Windows systems, all data comes from
    :man:`getpwuid_r(3)`. On Windows, uid and gid are set to -1 and have no
    meaning, and shell is `NULL`. After successfully calling this function, the
    memory allocated to `pwd` needs to be freed with
    :c:func:`uv_os_free_passwd`.
 
    .. versionadded:: 1.9.0
 
.. c:function:: void uv_os_free_passwd(uv_passwd_t* pwd)

libuv/samples/socks5-proxy/client.c  view on Meta::CPAN

241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
  }
 
  methods = s5_auth_methods(parser);
  if ((methods & S5_AUTH_NONE) && can_auth_none(cx->sx, cx)) {
    s5_select_auth(parser, S5_AUTH_NONE);
    conn_write(incoming, "\5\0", 2);  /* No auth required. */
    return s_req_start;
  }
 
  if ((methods & S5_AUTH_PASSWD) && can_auth_passwd(cx->sx, cx)) {
    /* TODO(bnoordhuis) Implement username/password auth. */
  }
 
  conn_write(incoming, "\5\377", 2);  /* No acceptable auth. */
  return s_kill;
}
 
/* TODO(bnoordhuis) Implement username/password auth. */
static int do_handshake_auth(client_ctx *cx) {
  UNREACHABLE();
  return do_kill(cx);
}
 
static int do_req_start(client_ctx *cx) {
  conn *incoming;
 
  incoming = &cx->incoming;
  ASSERT(incoming->rdstate == c_stop);

libuv/samples/socks5-proxy/s5.c  view on Meta::CPAN

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <string.h>  /* memset() */
 
enum {
  s5_version,
  s5_nmethods,
  s5_methods,
  s5_auth_pw_version,
  s5_auth_pw_userlen,
  s5_auth_pw_username,
  s5_auth_pw_passlen,
  s5_auth_pw_password,
  s5_req_version,
  s5_req_cmd,
  s5_req_reserved,
  s5_req_atyp,
  s5_req_atyp_host,
  s5_req_daddr,
  s5_req_dport0,
  s5_req_dport1,
  s5_dead
};

libuv/samples/socks5-proxy/s5.c  view on Meta::CPAN

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
  }
  if (cx->arg0 == cx->userlen) {
    cx->username[cx->userlen] = '\0';
    cx->state = s5_auth_pw_passlen;
  }
  break;
 
case s5_auth_pw_passlen:
  cx->arg0 = 0;
  cx->passlen = c;
  cx->state = s5_auth_pw_password;
  break;
 
case s5_auth_pw_password:
  if (cx->arg0 < cx->passlen) {
    cx->password[cx->arg0] = c;
    cx->arg0 += 1;
  }
  if (cx->arg0 == cx->passlen) {
    cx->password[cx->passlen] = '\0';
    cx->state = s5_req_version;
    err = s5_auth_verify;
    goto out;
  }
  break;
 
case s5_req_version:
  if (c != 5) {
    err = s5_bad_version;
    goto out;

libuv/samples/socks5-proxy/s5.h  view on Meta::CPAN

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
  uint32_t arg0;  /* Scratch space for the state machine. */
  uint32_t arg1;  /* Scratch space for the state machine. */
  uint8_t state;
  uint8_t methods;
  uint8_t cmd;
  uint8_t atyp;
  uint8_t userlen;
  uint8_t passlen;
  uint16_t dport;
  uint8_t username[257];
  uint8_t password[257];
  uint8_t daddr[257];  /* TODO(bnoordhuis) Merge with username/password. */
} s5_ctx;
 
void s5_init(s5_ctx *ctx);
 
s5_err s5_parse(s5_ctx *cx, uint8_t **data, size_t *size);
 
/* Only call after s5_parse() has returned s5_want_auth_method. */
unsigned int s5_auth_methods(const s5_ctx *cx);
 
/* Call after s5_parse() has returned s5_want_auth_method. */



( run in 1.174 second using v1.01-cache-2.11-cpan-26ccb49234f )