12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370 |
- /* socks5.h -- generated by Trunnel v1.5.2.
- * https://gitweb.torproject.org/trunnel.git
- * You probably shouldn't edit this file.
- */
- #ifndef TRUNNEL_SOCKS5_H
- #define TRUNNEL_SOCKS5_H
- #include <stdint.h>
- #include "trunnel.h"
- #define CMD_CONNECT 1
- #define CMD_BIND 2
- #define CMD_UDP_ASSOCIATE 3
- #define CMD_RESOLVE_PTR 241
- #define ATYPE_IPV4 1
- #define ATYPE_IPV6 4
- #define ATYPE_DOMAINNAME 3
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_DOMAINNAME)
- struct domainname_st {
- uint8_t len;
- trunnel_string_t name;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct domainname_st domainname_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS4_CLIENT_REQUEST)
- struct socks4_client_request_st {
- uint8_t version;
- uint8_t command;
- uint16_t port;
- uint32_t addr;
- char *username;
- char *socks4a_addr_hostname;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks4_client_request_st socks4_client_request_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS4_SERVER_REPLY)
- struct socks4_server_reply_st {
- uint8_t version;
- uint8_t status;
- uint16_t port;
- uint32_t addr;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks4_server_reply_st socks4_server_reply_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS5_CLIENT_USERPASS_AUTH)
- struct socks5_client_userpass_auth_st {
- uint8_t version;
- uint8_t username_len;
- trunnel_string_t username;
- uint8_t passwd_len;
- trunnel_string_t passwd;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks5_client_userpass_auth_st socks5_client_userpass_auth_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS5_CLIENT_VERSION)
- struct socks5_client_version_st {
- uint8_t version;
- uint8_t n_methods;
- TRUNNEL_DYNARRAY_HEAD(, uint8_t) methods;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks5_client_version_st socks5_client_version_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS5_SERVER_METHOD)
- struct socks5_server_method_st {
- uint8_t version;
- uint8_t method;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks5_server_method_st socks5_server_method_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS5_SERVER_USERPATH_AUTH)
- struct socks5_server_userpath_auth_st {
- uint8_t version;
- uint8_t status;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks5_server_userpath_auth_st socks5_server_userpath_auth_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TOR_SOCKSAUTH_KEYVAL)
- struct tor_socksauth_keyval_st {
- uint16_t keylen;
- trunnel_string_t key;
- uint16_t vallen;
- trunnel_string_t val;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct tor_socksauth_keyval_st tor_socksauth_keyval_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS5_CLIENT_REQUEST)
- struct socks5_client_request_st {
- uint8_t version;
- uint8_t command;
- uint8_t reserved;
- uint8_t atype;
- uint32_t dest_addr_ipv4;
- uint8_t dest_addr_ipv6[16];
- struct domainname_st *dest_addr_domainname;
- uint16_t dest_port;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks5_client_request_st socks5_client_request_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_SOCKS5_SERVER_REPLY)
- struct socks5_server_reply_st {
- uint8_t version;
- uint8_t reply;
- uint8_t reserved;
- uint8_t atype;
- uint32_t bind_addr_ipv4;
- uint8_t bind_addr_ipv6[16];
- struct domainname_st *bind_addr_domainname;
- uint16_t bind_port;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct socks5_server_reply_st socks5_server_reply_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TOR_EXTENDED_SOCKS_AUTH_REQUEST)
- struct tor_extended_socks_auth_request_st {
- uint8_t version;
- uint16_t npairs;
- TRUNNEL_DYNARRAY_HEAD(, struct tor_socksauth_keyval_st *) pairs;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct tor_extended_socks_auth_request_st tor_extended_socks_auth_request_t;
- #if !defined(TRUNNEL_OPAQUE) && !defined(TRUNNEL_OPAQUE_TOR_EXTENDED_SOCKS_AUTH_RESPONSE)
- struct tor_extended_socks_auth_response_st {
- uint8_t version;
- uint8_t status;
- uint16_t npairs;
- TRUNNEL_DYNARRAY_HEAD(, struct tor_socksauth_keyval_st *) pairs;
- uint8_t trunnel_error_code_;
- };
- #endif
- typedef struct tor_extended_socks_auth_response_st tor_extended_socks_auth_response_t;
- /** Return a newly allocated domainname with all elements set to zero.
- */
- domainname_t *domainname_new(void);
- /** Release all storage held by the domainname in 'victim'. (Do
- * nothing if 'victim' is NULL.)
- */
- void domainname_free(domainname_t *victim);
- /** Try to parse a domainname from the buffer in 'input', using up to
- * 'len_in' bytes from the input buffer. On success, return the number
- * of bytes consumed and set *output to the newly allocated
- * domainname_t. On failure, return -2 if the input appears truncated,
- * and -1 if the input is otherwise invalid.
- */
- ssize_t domainname_parse(domainname_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * domainname in 'obj'. On failure, return a negative value. Note that
- * this value may be an overestimate, and can even be an underestimate
- * for certain unencodeable objects.
- */
- ssize_t domainname_encoded_len(const domainname_t *obj);
- /** Try to encode the domainname from 'input' into the buffer at
- * 'output', using up to 'avail' bytes of the output buffer. On
- * success, return the number of bytes used. On failure, return -2 if
- * the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t domainname_encode(uint8_t *output, size_t avail, const domainname_t *input);
- /** Check whether the internal state of the domainname in 'obj' is
- * consistent. Return NULL if it is, and a short message if it is not.
- */
- const char *domainname_check(const domainname_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int domainname_clear_errors(domainname_t *obj);
- /** Return the value of the len field of the domainname_t in 'inp'
- */
- uint8_t domainname_get_len(const domainname_t *inp);
- /** Set the value of the len field of the domainname_t in 'inp' to
- * 'val'. Return 0 on success; return -1 and set the error code on
- * 'inp' on failure.
- */
- int domainname_set_len(domainname_t *inp, uint8_t val);
- /** Return the length of the dynamic array holding the name field of
- * the domainname_t in 'inp'.
- */
- size_t domainname_getlen_name(const domainname_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * name of the domainname_t in 'inp'.
- */
- char domainname_get_name(domainname_t *inp, size_t idx);
- /** As domainname_get_name, but take and return a const pointer
- */
- char domainname_getconst_name(const domainname_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * name of the domainname_t in 'inp', so that it will hold the value
- * 'elt'.
- */
- int domainname_set_name(domainname_t *inp, size_t idx, char elt);
- /** Append a new element 'elt' to the dynamic array field name of the
- * domainname_t in 'inp'.
- */
- int domainname_add_name(domainname_t *inp, char elt);
- /** Return a pointer to the variable-length array field name of 'inp'.
- */
- char * domainname_getarray_name(domainname_t *inp);
- /** As domainname_get_name, but take and return a const pointer
- */
- const char * domainname_getconstarray_name(const domainname_t *inp);
- /** Change the length of the variable-length array field name of 'inp'
- * to 'newlen'.Fill extra elements with 0. Return 0 on success; return
- * -1 and set the error code on 'inp' on failure.
- */
- int domainname_setlen_name(domainname_t *inp, size_t newlen);
- /** Return the value of the name field of a domainname_t as a NUL-
- * terminated string.
- */
- const char * domainname_getstr_name(domainname_t *inp);
- /** Set the value of the name field of a domainname_t to a given
- * string of length 'len'. Return 0 on success; return -1 and set the
- * error code on 'inp' on failure.
- */
- int domainname_setstr0_name(domainname_t *inp, const char *val, size_t len);
- /** Set the value of the name field of a domainname_t to a given NUL-
- * terminated string. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int domainname_setstr_name(domainname_t *inp, const char *val);
- /** Return a newly allocated socks4_client_request with all elements
- * set to zero.
- */
- socks4_client_request_t *socks4_client_request_new(void);
- /** Release all storage held by the socks4_client_request in 'victim'.
- * (Do nothing if 'victim' is NULL.)
- */
- void socks4_client_request_free(socks4_client_request_t *victim);
- /** Try to parse a socks4_client_request from the buffer in 'input',
- * using up to 'len_in' bytes from the input buffer. On success,
- * return the number of bytes consumed and set *output to the newly
- * allocated socks4_client_request_t. On failure, return -2 if the
- * input appears truncated, and -1 if the input is otherwise invalid.
- */
- ssize_t socks4_client_request_parse(socks4_client_request_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks4_client_request in 'obj'. On failure, return a negative
- * value. Note that this value may be an overestimate, and can even be
- * an underestimate for certain unencodeable objects.
- */
- ssize_t socks4_client_request_encoded_len(const socks4_client_request_t *obj);
- /** Try to encode the socks4_client_request from 'input' into the
- * buffer at 'output', using up to 'avail' bytes of the output buffer.
- * On success, return the number of bytes used. On failure, return -2
- * if the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t socks4_client_request_encode(uint8_t *output, size_t avail, const socks4_client_request_t *input);
- /** Check whether the internal state of the socks4_client_request in
- * 'obj' is consistent. Return NULL if it is, and a short message if
- * it is not.
- */
- const char *socks4_client_request_check(const socks4_client_request_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks4_client_request_clear_errors(socks4_client_request_t *obj);
- /** Return the value of the version field of the
- * socks4_client_request_t in 'inp'
- */
- uint8_t socks4_client_request_get_version(const socks4_client_request_t *inp);
- /** Set the value of the version field of the socks4_client_request_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_client_request_set_version(socks4_client_request_t *inp, uint8_t val);
- /** Return the value of the command field of the
- * socks4_client_request_t in 'inp'
- */
- uint8_t socks4_client_request_get_command(const socks4_client_request_t *inp);
- /** Set the value of the command field of the socks4_client_request_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_client_request_set_command(socks4_client_request_t *inp, uint8_t val);
- /** Return the value of the port field of the socks4_client_request_t
- * in 'inp'
- */
- uint16_t socks4_client_request_get_port(const socks4_client_request_t *inp);
- /** Set the value of the port field of the socks4_client_request_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_client_request_set_port(socks4_client_request_t *inp, uint16_t val);
- /** Return the value of the addr field of the socks4_client_request_t
- * in 'inp'
- */
- uint32_t socks4_client_request_get_addr(const socks4_client_request_t *inp);
- /** Set the value of the addr field of the socks4_client_request_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_client_request_set_addr(socks4_client_request_t *inp, uint32_t val);
- /** Return the value of the username field of the
- * socks4_client_request_t in 'inp'
- */
- const char * socks4_client_request_get_username(const socks4_client_request_t *inp);
- /** Set the value of the username field of the socks4_client_request_t
- * in 'inp' to 'val'. Free the old value if any. Does not steal the
- * reference to 'val'.Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_client_request_set_username(socks4_client_request_t *inp, const char *val);
- /** Return the value of the socks4a_addr_hostname field of the
- * socks4_client_request_t in 'inp'
- */
- const char * socks4_client_request_get_socks4a_addr_hostname(const socks4_client_request_t *inp);
- /** Set the value of the socks4a_addr_hostname field of the
- * socks4_client_request_t in 'inp' to 'val'. Free the old value if
- * any. Does not steal the reference to 'val'.Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks4_client_request_set_socks4a_addr_hostname(socks4_client_request_t *inp, const char *val);
- /** Return a newly allocated socks4_server_reply with all elements set
- * to zero.
- */
- socks4_server_reply_t *socks4_server_reply_new(void);
- /** Release all storage held by the socks4_server_reply in 'victim'.
- * (Do nothing if 'victim' is NULL.)
- */
- void socks4_server_reply_free(socks4_server_reply_t *victim);
- /** Try to parse a socks4_server_reply from the buffer in 'input',
- * using up to 'len_in' bytes from the input buffer. On success,
- * return the number of bytes consumed and set *output to the newly
- * allocated socks4_server_reply_t. On failure, return -2 if the input
- * appears truncated, and -1 if the input is otherwise invalid.
- */
- ssize_t socks4_server_reply_parse(socks4_server_reply_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks4_server_reply in 'obj'. On failure, return a negative value.
- * Note that this value may be an overestimate, and can even be an
- * underestimate for certain unencodeable objects.
- */
- ssize_t socks4_server_reply_encoded_len(const socks4_server_reply_t *obj);
- /** Try to encode the socks4_server_reply from 'input' into the buffer
- * at 'output', using up to 'avail' bytes of the output buffer. On
- * success, return the number of bytes used. On failure, return -2 if
- * the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t socks4_server_reply_encode(uint8_t *output, size_t avail, const socks4_server_reply_t *input);
- /** Check whether the internal state of the socks4_server_reply in
- * 'obj' is consistent. Return NULL if it is, and a short message if
- * it is not.
- */
- const char *socks4_server_reply_check(const socks4_server_reply_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks4_server_reply_clear_errors(socks4_server_reply_t *obj);
- /** Return the value of the version field of the socks4_server_reply_t
- * in 'inp'
- */
- uint8_t socks4_server_reply_get_version(const socks4_server_reply_t *inp);
- /** Set the value of the version field of the socks4_server_reply_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_server_reply_set_version(socks4_server_reply_t *inp, uint8_t val);
- /** Return the value of the status field of the socks4_server_reply_t
- * in 'inp'
- */
- uint8_t socks4_server_reply_get_status(const socks4_server_reply_t *inp);
- /** Set the value of the status field of the socks4_server_reply_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_server_reply_set_status(socks4_server_reply_t *inp, uint8_t val);
- /** Return the value of the port field of the socks4_server_reply_t in
- * 'inp'
- */
- uint16_t socks4_server_reply_get_port(const socks4_server_reply_t *inp);
- /** Set the value of the port field of the socks4_server_reply_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_server_reply_set_port(socks4_server_reply_t *inp, uint16_t val);
- /** Return the value of the addr field of the socks4_server_reply_t in
- * 'inp'
- */
- uint32_t socks4_server_reply_get_addr(const socks4_server_reply_t *inp);
- /** Set the value of the addr field of the socks4_server_reply_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks4_server_reply_set_addr(socks4_server_reply_t *inp, uint32_t val);
- /** Return a newly allocated socks5_client_userpass_auth with all
- * elements set to zero.
- */
- socks5_client_userpass_auth_t *socks5_client_userpass_auth_new(void);
- /** Release all storage held by the socks5_client_userpass_auth in
- * 'victim'. (Do nothing if 'victim' is NULL.)
- */
- void socks5_client_userpass_auth_free(socks5_client_userpass_auth_t *victim);
- /** Try to parse a socks5_client_userpass_auth from the buffer in
- * 'input', using up to 'len_in' bytes from the input buffer. On
- * success, return the number of bytes consumed and set *output to the
- * newly allocated socks5_client_userpass_auth_t. On failure, return
- * -2 if the input appears truncated, and -1 if the input is otherwise
- * invalid.
- */
- ssize_t socks5_client_userpass_auth_parse(socks5_client_userpass_auth_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks5_client_userpass_auth in 'obj'. On failure, return a negative
- * value. Note that this value may be an overestimate, and can even be
- * an underestimate for certain unencodeable objects.
- */
- ssize_t socks5_client_userpass_auth_encoded_len(const socks5_client_userpass_auth_t *obj);
- /** Try to encode the socks5_client_userpass_auth from 'input' into
- * the buffer at 'output', using up to 'avail' bytes of the output
- * buffer. On success, return the number of bytes used. On failure,
- * return -2 if the buffer was not long enough, and -1 if the input
- * was invalid.
- */
- ssize_t socks5_client_userpass_auth_encode(uint8_t *output, size_t avail, const socks5_client_userpass_auth_t *input);
- /** Check whether the internal state of the
- * socks5_client_userpass_auth in 'obj' is consistent. Return NULL if
- * it is, and a short message if it is not.
- */
- const char *socks5_client_userpass_auth_check(const socks5_client_userpass_auth_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks5_client_userpass_auth_clear_errors(socks5_client_userpass_auth_t *obj);
- /** Return the value of the version field of the
- * socks5_client_userpass_auth_t in 'inp'
- */
- uint8_t socks5_client_userpass_auth_get_version(const socks5_client_userpass_auth_t *inp);
- /** Set the value of the version field of the
- * socks5_client_userpass_auth_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_userpass_auth_set_version(socks5_client_userpass_auth_t *inp, uint8_t val);
- /** Return the value of the username_len field of the
- * socks5_client_userpass_auth_t in 'inp'
- */
- uint8_t socks5_client_userpass_auth_get_username_len(const socks5_client_userpass_auth_t *inp);
- /** Set the value of the username_len field of the
- * socks5_client_userpass_auth_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_userpass_auth_set_username_len(socks5_client_userpass_auth_t *inp, uint8_t val);
- /** Return the length of the dynamic array holding the username field
- * of the socks5_client_userpass_auth_t in 'inp'.
- */
- size_t socks5_client_userpass_auth_getlen_username(const socks5_client_userpass_auth_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * username of the socks5_client_userpass_auth_t in 'inp'.
- */
- char socks5_client_userpass_auth_get_username(socks5_client_userpass_auth_t *inp, size_t idx);
- /** As socks5_client_userpass_auth_get_username, but take and return a
- * const pointer
- */
- char socks5_client_userpass_auth_getconst_username(const socks5_client_userpass_auth_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * username of the socks5_client_userpass_auth_t in 'inp', so that it
- * will hold the value 'elt'.
- */
- int socks5_client_userpass_auth_set_username(socks5_client_userpass_auth_t *inp, size_t idx, char elt);
- /** Append a new element 'elt' to the dynamic array field username of
- * the socks5_client_userpass_auth_t in 'inp'.
- */
- int socks5_client_userpass_auth_add_username(socks5_client_userpass_auth_t *inp, char elt);
- /** Return a pointer to the variable-length array field username of
- * 'inp'.
- */
- char * socks5_client_userpass_auth_getarray_username(socks5_client_userpass_auth_t *inp);
- /** As socks5_client_userpass_auth_get_username, but take and return a
- * const pointer
- */
- const char * socks5_client_userpass_auth_getconstarray_username(const socks5_client_userpass_auth_t *inp);
- /** Change the length of the variable-length array field username of
- * 'inp' to 'newlen'.Fill extra elements with 0. Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_userpass_auth_setlen_username(socks5_client_userpass_auth_t *inp, size_t newlen);
- /** Return the value of the username field of a
- * socks5_client_userpass_auth_t as a NUL-terminated string.
- */
- const char * socks5_client_userpass_auth_getstr_username(socks5_client_userpass_auth_t *inp);
- /** Set the value of the username field of a
- * socks5_client_userpass_auth_t to a given string of length 'len'.
- * Return 0 on success; return -1 and set the error code on 'inp' on
- * failure.
- */
- int socks5_client_userpass_auth_setstr0_username(socks5_client_userpass_auth_t *inp, const char *val, size_t len);
- /** Set the value of the username field of a
- * socks5_client_userpass_auth_t to a given NUL-terminated string.
- * Return 0 on success; return -1 and set the error code on 'inp' on
- * failure.
- */
- int socks5_client_userpass_auth_setstr_username(socks5_client_userpass_auth_t *inp, const char *val);
- /** Return the value of the passwd_len field of the
- * socks5_client_userpass_auth_t in 'inp'
- */
- uint8_t socks5_client_userpass_auth_get_passwd_len(const socks5_client_userpass_auth_t *inp);
- /** Set the value of the passwd_len field of the
- * socks5_client_userpass_auth_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_userpass_auth_set_passwd_len(socks5_client_userpass_auth_t *inp, uint8_t val);
- /** Return the length of the dynamic array holding the passwd field of
- * the socks5_client_userpass_auth_t in 'inp'.
- */
- size_t socks5_client_userpass_auth_getlen_passwd(const socks5_client_userpass_auth_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * passwd of the socks5_client_userpass_auth_t in 'inp'.
- */
- char socks5_client_userpass_auth_get_passwd(socks5_client_userpass_auth_t *inp, size_t idx);
- /** As socks5_client_userpass_auth_get_passwd, but take and return a
- * const pointer
- */
- char socks5_client_userpass_auth_getconst_passwd(const socks5_client_userpass_auth_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * passwd of the socks5_client_userpass_auth_t in 'inp', so that it
- * will hold the value 'elt'.
- */
- int socks5_client_userpass_auth_set_passwd(socks5_client_userpass_auth_t *inp, size_t idx, char elt);
- /** Append a new element 'elt' to the dynamic array field passwd of
- * the socks5_client_userpass_auth_t in 'inp'.
- */
- int socks5_client_userpass_auth_add_passwd(socks5_client_userpass_auth_t *inp, char elt);
- /** Return a pointer to the variable-length array field passwd of
- * 'inp'.
- */
- char * socks5_client_userpass_auth_getarray_passwd(socks5_client_userpass_auth_t *inp);
- /** As socks5_client_userpass_auth_get_passwd, but take and return a
- * const pointer
- */
- const char * socks5_client_userpass_auth_getconstarray_passwd(const socks5_client_userpass_auth_t *inp);
- /** Change the length of the variable-length array field passwd of
- * 'inp' to 'newlen'.Fill extra elements with 0. Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_userpass_auth_setlen_passwd(socks5_client_userpass_auth_t *inp, size_t newlen);
- /** Return the value of the passwd field of a
- * socks5_client_userpass_auth_t as a NUL-terminated string.
- */
- const char * socks5_client_userpass_auth_getstr_passwd(socks5_client_userpass_auth_t *inp);
- /** Set the value of the passwd field of a
- * socks5_client_userpass_auth_t to a given string of length 'len'.
- * Return 0 on success; return -1 and set the error code on 'inp' on
- * failure.
- */
- int socks5_client_userpass_auth_setstr0_passwd(socks5_client_userpass_auth_t *inp, const char *val, size_t len);
- /** Set the value of the passwd field of a
- * socks5_client_userpass_auth_t to a given NUL-terminated string.
- * Return 0 on success; return -1 and set the error code on 'inp' on
- * failure.
- */
- int socks5_client_userpass_auth_setstr_passwd(socks5_client_userpass_auth_t *inp, const char *val);
- /** Return a newly allocated socks5_client_version with all elements
- * set to zero.
- */
- socks5_client_version_t *socks5_client_version_new(void);
- /** Release all storage held by the socks5_client_version in 'victim'.
- * (Do nothing if 'victim' is NULL.)
- */
- void socks5_client_version_free(socks5_client_version_t *victim);
- /** Try to parse a socks5_client_version from the buffer in 'input',
- * using up to 'len_in' bytes from the input buffer. On success,
- * return the number of bytes consumed and set *output to the newly
- * allocated socks5_client_version_t. On failure, return -2 if the
- * input appears truncated, and -1 if the input is otherwise invalid.
- */
- ssize_t socks5_client_version_parse(socks5_client_version_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks5_client_version in 'obj'. On failure, return a negative
- * value. Note that this value may be an overestimate, and can even be
- * an underestimate for certain unencodeable objects.
- */
- ssize_t socks5_client_version_encoded_len(const socks5_client_version_t *obj);
- /** Try to encode the socks5_client_version from 'input' into the
- * buffer at 'output', using up to 'avail' bytes of the output buffer.
- * On success, return the number of bytes used. On failure, return -2
- * if the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t socks5_client_version_encode(uint8_t *output, size_t avail, const socks5_client_version_t *input);
- /** Check whether the internal state of the socks5_client_version in
- * 'obj' is consistent. Return NULL if it is, and a short message if
- * it is not.
- */
- const char *socks5_client_version_check(const socks5_client_version_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks5_client_version_clear_errors(socks5_client_version_t *obj);
- /** Return the value of the version field of the
- * socks5_client_version_t in 'inp'
- */
- uint8_t socks5_client_version_get_version(const socks5_client_version_t *inp);
- /** Set the value of the version field of the socks5_client_version_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_client_version_set_version(socks5_client_version_t *inp, uint8_t val);
- /** Return the value of the n_methods field of the
- * socks5_client_version_t in 'inp'
- */
- uint8_t socks5_client_version_get_n_methods(const socks5_client_version_t *inp);
- /** Set the value of the n_methods field of the
- * socks5_client_version_t in 'inp' to 'val'. Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_version_set_n_methods(socks5_client_version_t *inp, uint8_t val);
- /** Return the length of the dynamic array holding the methods field
- * of the socks5_client_version_t in 'inp'.
- */
- size_t socks5_client_version_getlen_methods(const socks5_client_version_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * methods of the socks5_client_version_t in 'inp'.
- */
- uint8_t socks5_client_version_get_methods(socks5_client_version_t *inp, size_t idx);
- /** As socks5_client_version_get_methods, but take and return a const
- * pointer
- */
- uint8_t socks5_client_version_getconst_methods(const socks5_client_version_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * methods of the socks5_client_version_t in 'inp', so that it will
- * hold the value 'elt'.
- */
- int socks5_client_version_set_methods(socks5_client_version_t *inp, size_t idx, uint8_t elt);
- /** Append a new element 'elt' to the dynamic array field methods of
- * the socks5_client_version_t in 'inp'.
- */
- int socks5_client_version_add_methods(socks5_client_version_t *inp, uint8_t elt);
- /** Return a pointer to the variable-length array field methods of
- * 'inp'.
- */
- uint8_t * socks5_client_version_getarray_methods(socks5_client_version_t *inp);
- /** As socks5_client_version_get_methods, but take and return a const
- * pointer
- */
- const uint8_t * socks5_client_version_getconstarray_methods(const socks5_client_version_t *inp);
- /** Change the length of the variable-length array field methods of
- * 'inp' to 'newlen'.Fill extra elements with 0. Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_version_setlen_methods(socks5_client_version_t *inp, size_t newlen);
- /** Return a newly allocated socks5_server_method with all elements
- * set to zero.
- */
- socks5_server_method_t *socks5_server_method_new(void);
- /** Release all storage held by the socks5_server_method in 'victim'.
- * (Do nothing if 'victim' is NULL.)
- */
- void socks5_server_method_free(socks5_server_method_t *victim);
- /** Try to parse a socks5_server_method from the buffer in 'input',
- * using up to 'len_in' bytes from the input buffer. On success,
- * return the number of bytes consumed and set *output to the newly
- * allocated socks5_server_method_t. On failure, return -2 if the
- * input appears truncated, and -1 if the input is otherwise invalid.
- */
- ssize_t socks5_server_method_parse(socks5_server_method_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks5_server_method in 'obj'. On failure, return a negative value.
- * Note that this value may be an overestimate, and can even be an
- * underestimate for certain unencodeable objects.
- */
- ssize_t socks5_server_method_encoded_len(const socks5_server_method_t *obj);
- /** Try to encode the socks5_server_method from 'input' into the
- * buffer at 'output', using up to 'avail' bytes of the output buffer.
- * On success, return the number of bytes used. On failure, return -2
- * if the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t socks5_server_method_encode(uint8_t *output, size_t avail, const socks5_server_method_t *input);
- /** Check whether the internal state of the socks5_server_method in
- * 'obj' is consistent. Return NULL if it is, and a short message if
- * it is not.
- */
- const char *socks5_server_method_check(const socks5_server_method_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks5_server_method_clear_errors(socks5_server_method_t *obj);
- /** Return the value of the version field of the
- * socks5_server_method_t in 'inp'
- */
- uint8_t socks5_server_method_get_version(const socks5_server_method_t *inp);
- /** Set the value of the version field of the socks5_server_method_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_server_method_set_version(socks5_server_method_t *inp, uint8_t val);
- /** Return the value of the method field of the socks5_server_method_t
- * in 'inp'
- */
- uint8_t socks5_server_method_get_method(const socks5_server_method_t *inp);
- /** Set the value of the method field of the socks5_server_method_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_server_method_set_method(socks5_server_method_t *inp, uint8_t val);
- /** Return a newly allocated socks5_server_userpath_auth with all
- * elements set to zero.
- */
- socks5_server_userpath_auth_t *socks5_server_userpath_auth_new(void);
- /** Release all storage held by the socks5_server_userpath_auth in
- * 'victim'. (Do nothing if 'victim' is NULL.)
- */
- void socks5_server_userpath_auth_free(socks5_server_userpath_auth_t *victim);
- /** Try to parse a socks5_server_userpath_auth from the buffer in
- * 'input', using up to 'len_in' bytes from the input buffer. On
- * success, return the number of bytes consumed and set *output to the
- * newly allocated socks5_server_userpath_auth_t. On failure, return
- * -2 if the input appears truncated, and -1 if the input is otherwise
- * invalid.
- */
- ssize_t socks5_server_userpath_auth_parse(socks5_server_userpath_auth_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks5_server_userpath_auth in 'obj'. On failure, return a negative
- * value. Note that this value may be an overestimate, and can even be
- * an underestimate for certain unencodeable objects.
- */
- ssize_t socks5_server_userpath_auth_encoded_len(const socks5_server_userpath_auth_t *obj);
- /** Try to encode the socks5_server_userpath_auth from 'input' into
- * the buffer at 'output', using up to 'avail' bytes of the output
- * buffer. On success, return the number of bytes used. On failure,
- * return -2 if the buffer was not long enough, and -1 if the input
- * was invalid.
- */
- ssize_t socks5_server_userpath_auth_encode(uint8_t *output, size_t avail, const socks5_server_userpath_auth_t *input);
- /** Check whether the internal state of the
- * socks5_server_userpath_auth in 'obj' is consistent. Return NULL if
- * it is, and a short message if it is not.
- */
- const char *socks5_server_userpath_auth_check(const socks5_server_userpath_auth_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks5_server_userpath_auth_clear_errors(socks5_server_userpath_auth_t *obj);
- /** Return the value of the version field of the
- * socks5_server_userpath_auth_t in 'inp'
- */
- uint8_t socks5_server_userpath_auth_get_version(const socks5_server_userpath_auth_t *inp);
- /** Set the value of the version field of the
- * socks5_server_userpath_auth_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int socks5_server_userpath_auth_set_version(socks5_server_userpath_auth_t *inp, uint8_t val);
- /** Return the value of the status field of the
- * socks5_server_userpath_auth_t in 'inp'
- */
- uint8_t socks5_server_userpath_auth_get_status(const socks5_server_userpath_auth_t *inp);
- /** Set the value of the status field of the
- * socks5_server_userpath_auth_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int socks5_server_userpath_auth_set_status(socks5_server_userpath_auth_t *inp, uint8_t val);
- /** Return a newly allocated tor_socksauth_keyval with all elements
- * set to zero.
- */
- tor_socksauth_keyval_t *tor_socksauth_keyval_new(void);
- /** Release all storage held by the tor_socksauth_keyval in 'victim'.
- * (Do nothing if 'victim' is NULL.)
- */
- void tor_socksauth_keyval_free(tor_socksauth_keyval_t *victim);
- /** Try to parse a tor_socksauth_keyval from the buffer in 'input',
- * using up to 'len_in' bytes from the input buffer. On success,
- * return the number of bytes consumed and set *output to the newly
- * allocated tor_socksauth_keyval_t. On failure, return -2 if the
- * input appears truncated, and -1 if the input is otherwise invalid.
- */
- ssize_t tor_socksauth_keyval_parse(tor_socksauth_keyval_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * tor_socksauth_keyval in 'obj'. On failure, return a negative value.
- * Note that this value may be an overestimate, and can even be an
- * underestimate for certain unencodeable objects.
- */
- ssize_t tor_socksauth_keyval_encoded_len(const tor_socksauth_keyval_t *obj);
- /** Try to encode the tor_socksauth_keyval from 'input' into the
- * buffer at 'output', using up to 'avail' bytes of the output buffer.
- * On success, return the number of bytes used. On failure, return -2
- * if the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t tor_socksauth_keyval_encode(uint8_t *output, size_t avail, const tor_socksauth_keyval_t *input);
- /** Check whether the internal state of the tor_socksauth_keyval in
- * 'obj' is consistent. Return NULL if it is, and a short message if
- * it is not.
- */
- const char *tor_socksauth_keyval_check(const tor_socksauth_keyval_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int tor_socksauth_keyval_clear_errors(tor_socksauth_keyval_t *obj);
- /** Return the value of the keylen field of the tor_socksauth_keyval_t
- * in 'inp'
- */
- uint16_t tor_socksauth_keyval_get_keylen(const tor_socksauth_keyval_t *inp);
- /** Set the value of the keylen field of the tor_socksauth_keyval_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int tor_socksauth_keyval_set_keylen(tor_socksauth_keyval_t *inp, uint16_t val);
- /** Return the length of the dynamic array holding the key field of
- * the tor_socksauth_keyval_t in 'inp'.
- */
- size_t tor_socksauth_keyval_getlen_key(const tor_socksauth_keyval_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * key of the tor_socksauth_keyval_t in 'inp'.
- */
- char tor_socksauth_keyval_get_key(tor_socksauth_keyval_t *inp, size_t idx);
- /** As tor_socksauth_keyval_get_key, but take and return a const
- * pointer
- */
- char tor_socksauth_keyval_getconst_key(const tor_socksauth_keyval_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * key of the tor_socksauth_keyval_t in 'inp', so that it will hold
- * the value 'elt'.
- */
- int tor_socksauth_keyval_set_key(tor_socksauth_keyval_t *inp, size_t idx, char elt);
- /** Append a new element 'elt' to the dynamic array field key of the
- * tor_socksauth_keyval_t in 'inp'.
- */
- int tor_socksauth_keyval_add_key(tor_socksauth_keyval_t *inp, char elt);
- /** Return a pointer to the variable-length array field key of 'inp'.
- */
- char * tor_socksauth_keyval_getarray_key(tor_socksauth_keyval_t *inp);
- /** As tor_socksauth_keyval_get_key, but take and return a const
- * pointer
- */
- const char * tor_socksauth_keyval_getconstarray_key(const tor_socksauth_keyval_t *inp);
- /** Change the length of the variable-length array field key of 'inp'
- * to 'newlen'.Fill extra elements with 0. Return 0 on success; return
- * -1 and set the error code on 'inp' on failure.
- */
- int tor_socksauth_keyval_setlen_key(tor_socksauth_keyval_t *inp, size_t newlen);
- /** Return the value of the key field of a tor_socksauth_keyval_t as a
- * NUL-terminated string.
- */
- const char * tor_socksauth_keyval_getstr_key(tor_socksauth_keyval_t *inp);
- /** Set the value of the key field of a tor_socksauth_keyval_t to a
- * given string of length 'len'. Return 0 on success; return -1 and
- * set the error code on 'inp' on failure.
- */
- int tor_socksauth_keyval_setstr0_key(tor_socksauth_keyval_t *inp, const char *val, size_t len);
- /** Set the value of the key field of a tor_socksauth_keyval_t to a
- * given NUL-terminated string. Return 0 on success; return -1 and set
- * the error code on 'inp' on failure.
- */
- int tor_socksauth_keyval_setstr_key(tor_socksauth_keyval_t *inp, const char *val);
- /** Return the value of the vallen field of the tor_socksauth_keyval_t
- * in 'inp'
- */
- uint16_t tor_socksauth_keyval_get_vallen(const tor_socksauth_keyval_t *inp);
- /** Set the value of the vallen field of the tor_socksauth_keyval_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int tor_socksauth_keyval_set_vallen(tor_socksauth_keyval_t *inp, uint16_t val);
- /** Return the length of the dynamic array holding the val field of
- * the tor_socksauth_keyval_t in 'inp'.
- */
- size_t tor_socksauth_keyval_getlen_val(const tor_socksauth_keyval_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * val of the tor_socksauth_keyval_t in 'inp'.
- */
- char tor_socksauth_keyval_get_val(tor_socksauth_keyval_t *inp, size_t idx);
- /** As tor_socksauth_keyval_get_val, but take and return a const
- * pointer
- */
- char tor_socksauth_keyval_getconst_val(const tor_socksauth_keyval_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * val of the tor_socksauth_keyval_t in 'inp', so that it will hold
- * the value 'elt'.
- */
- int tor_socksauth_keyval_set_val(tor_socksauth_keyval_t *inp, size_t idx, char elt);
- /** Append a new element 'elt' to the dynamic array field val of the
- * tor_socksauth_keyval_t in 'inp'.
- */
- int tor_socksauth_keyval_add_val(tor_socksauth_keyval_t *inp, char elt);
- /** Return a pointer to the variable-length array field val of 'inp'.
- */
- char * tor_socksauth_keyval_getarray_val(tor_socksauth_keyval_t *inp);
- /** As tor_socksauth_keyval_get_val, but take and return a const
- * pointer
- */
- const char * tor_socksauth_keyval_getconstarray_val(const tor_socksauth_keyval_t *inp);
- /** Change the length of the variable-length array field val of 'inp'
- * to 'newlen'.Fill extra elements with 0. Return 0 on success; return
- * -1 and set the error code on 'inp' on failure.
- */
- int tor_socksauth_keyval_setlen_val(tor_socksauth_keyval_t *inp, size_t newlen);
- /** Return the value of the val field of a tor_socksauth_keyval_t as a
- * NUL-terminated string.
- */
- const char * tor_socksauth_keyval_getstr_val(tor_socksauth_keyval_t *inp);
- /** Set the value of the val field of a tor_socksauth_keyval_t to a
- * given string of length 'len'. Return 0 on success; return -1 and
- * set the error code on 'inp' on failure.
- */
- int tor_socksauth_keyval_setstr0_val(tor_socksauth_keyval_t *inp, const char *val, size_t len);
- /** Set the value of the val field of a tor_socksauth_keyval_t to a
- * given NUL-terminated string. Return 0 on success; return -1 and set
- * the error code on 'inp' on failure.
- */
- int tor_socksauth_keyval_setstr_val(tor_socksauth_keyval_t *inp, const char *val);
- /** Return a newly allocated socks5_client_request with all elements
- * set to zero.
- */
- socks5_client_request_t *socks5_client_request_new(void);
- /** Release all storage held by the socks5_client_request in 'victim'.
- * (Do nothing if 'victim' is NULL.)
- */
- void socks5_client_request_free(socks5_client_request_t *victim);
- /** Try to parse a socks5_client_request from the buffer in 'input',
- * using up to 'len_in' bytes from the input buffer. On success,
- * return the number of bytes consumed and set *output to the newly
- * allocated socks5_client_request_t. On failure, return -2 if the
- * input appears truncated, and -1 if the input is otherwise invalid.
- */
- ssize_t socks5_client_request_parse(socks5_client_request_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks5_client_request in 'obj'. On failure, return a negative
- * value. Note that this value may be an overestimate, and can even be
- * an underestimate for certain unencodeable objects.
- */
- ssize_t socks5_client_request_encoded_len(const socks5_client_request_t *obj);
- /** Try to encode the socks5_client_request from 'input' into the
- * buffer at 'output', using up to 'avail' bytes of the output buffer.
- * On success, return the number of bytes used. On failure, return -2
- * if the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t socks5_client_request_encode(uint8_t *output, size_t avail, const socks5_client_request_t *input);
- /** Check whether the internal state of the socks5_client_request in
- * 'obj' is consistent. Return NULL if it is, and a short message if
- * it is not.
- */
- const char *socks5_client_request_check(const socks5_client_request_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks5_client_request_clear_errors(socks5_client_request_t *obj);
- /** Return the value of the version field of the
- * socks5_client_request_t in 'inp'
- */
- uint8_t socks5_client_request_get_version(const socks5_client_request_t *inp);
- /** Set the value of the version field of the socks5_client_request_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_client_request_set_version(socks5_client_request_t *inp, uint8_t val);
- /** Return the value of the command field of the
- * socks5_client_request_t in 'inp'
- */
- uint8_t socks5_client_request_get_command(const socks5_client_request_t *inp);
- /** Set the value of the command field of the socks5_client_request_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_client_request_set_command(socks5_client_request_t *inp, uint8_t val);
- /** Return the value of the reserved field of the
- * socks5_client_request_t in 'inp'
- */
- uint8_t socks5_client_request_get_reserved(const socks5_client_request_t *inp);
- /** Set the value of the reserved field of the socks5_client_request_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_client_request_set_reserved(socks5_client_request_t *inp, uint8_t val);
- /** Return the value of the atype field of the socks5_client_request_t
- * in 'inp'
- */
- uint8_t socks5_client_request_get_atype(const socks5_client_request_t *inp);
- /** Set the value of the atype field of the socks5_client_request_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_client_request_set_atype(socks5_client_request_t *inp, uint8_t val);
- /** Return the value of the dest_addr_ipv4 field of the
- * socks5_client_request_t in 'inp'
- */
- uint32_t socks5_client_request_get_dest_addr_ipv4(const socks5_client_request_t *inp);
- /** Set the value of the dest_addr_ipv4 field of the
- * socks5_client_request_t in 'inp' to 'val'. Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_request_set_dest_addr_ipv4(socks5_client_request_t *inp, uint32_t val);
- /** Return the (constant) length of the array holding the
- * dest_addr_ipv6 field of the socks5_client_request_t in 'inp'.
- */
- size_t socks5_client_request_getlen_dest_addr_ipv6(const socks5_client_request_t *inp);
- /** Return the element at position 'idx' of the fixed array field
- * dest_addr_ipv6 of the socks5_client_request_t in 'inp'.
- */
- uint8_t socks5_client_request_get_dest_addr_ipv6(socks5_client_request_t *inp, size_t idx);
- /** As socks5_client_request_get_dest_addr_ipv6, but take and return a
- * const pointer
- */
- uint8_t socks5_client_request_getconst_dest_addr_ipv6(const socks5_client_request_t *inp, size_t idx);
- /** Change the element at position 'idx' of the fixed array field
- * dest_addr_ipv6 of the socks5_client_request_t in 'inp', so that it
- * will hold the value 'elt'.
- */
- int socks5_client_request_set_dest_addr_ipv6(socks5_client_request_t *inp, size_t idx, uint8_t elt);
- /** Return a pointer to the 16-element array field dest_addr_ipv6 of
- * 'inp'.
- */
- uint8_t * socks5_client_request_getarray_dest_addr_ipv6(socks5_client_request_t *inp);
- /** As socks5_client_request_get_dest_addr_ipv6, but take and return a
- * const pointer
- */
- const uint8_t * socks5_client_request_getconstarray_dest_addr_ipv6(const socks5_client_request_t *inp);
- /** Return the value of the dest_addr_domainname field of the
- * socks5_client_request_t in 'inp'
- */
- struct domainname_st * socks5_client_request_get_dest_addr_domainname(socks5_client_request_t *inp);
- /** As socks5_client_request_get_dest_addr_domainname, but take and
- * return a const pointer
- */
- const struct domainname_st * socks5_client_request_getconst_dest_addr_domainname(const socks5_client_request_t *inp);
- /** Set the value of the dest_addr_domainname field of the
- * socks5_client_request_t in 'inp' to 'val'. Free the old value if
- * any. Steals the referenceto 'val'.Return 0 on success; return -1
- * and set the error code on 'inp' on failure.
- */
- int socks5_client_request_set_dest_addr_domainname(socks5_client_request_t *inp, struct domainname_st *val);
- /** As socks5_client_request_set_dest_addr_domainname, but does not
- * free the previous value.
- */
- int socks5_client_request_set0_dest_addr_domainname(socks5_client_request_t *inp, struct domainname_st *val);
- /** Return the value of the dest_port field of the
- * socks5_client_request_t in 'inp'
- */
- uint16_t socks5_client_request_get_dest_port(const socks5_client_request_t *inp);
- /** Set the value of the dest_port field of the
- * socks5_client_request_t in 'inp' to 'val'. Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks5_client_request_set_dest_port(socks5_client_request_t *inp, uint16_t val);
- /** Return a newly allocated socks5_server_reply with all elements set
- * to zero.
- */
- socks5_server_reply_t *socks5_server_reply_new(void);
- /** Release all storage held by the socks5_server_reply in 'victim'.
- * (Do nothing if 'victim' is NULL.)
- */
- void socks5_server_reply_free(socks5_server_reply_t *victim);
- /** Try to parse a socks5_server_reply from the buffer in 'input',
- * using up to 'len_in' bytes from the input buffer. On success,
- * return the number of bytes consumed and set *output to the newly
- * allocated socks5_server_reply_t. On failure, return -2 if the input
- * appears truncated, and -1 if the input is otherwise invalid.
- */
- ssize_t socks5_server_reply_parse(socks5_server_reply_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * socks5_server_reply in 'obj'. On failure, return a negative value.
- * Note that this value may be an overestimate, and can even be an
- * underestimate for certain unencodeable objects.
- */
- ssize_t socks5_server_reply_encoded_len(const socks5_server_reply_t *obj);
- /** Try to encode the socks5_server_reply from 'input' into the buffer
- * at 'output', using up to 'avail' bytes of the output buffer. On
- * success, return the number of bytes used. On failure, return -2 if
- * the buffer was not long enough, and -1 if the input was invalid.
- */
- ssize_t socks5_server_reply_encode(uint8_t *output, size_t avail, const socks5_server_reply_t *input);
- /** Check whether the internal state of the socks5_server_reply in
- * 'obj' is consistent. Return NULL if it is, and a short message if
- * it is not.
- */
- const char *socks5_server_reply_check(const socks5_server_reply_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int socks5_server_reply_clear_errors(socks5_server_reply_t *obj);
- /** Return the value of the version field of the socks5_server_reply_t
- * in 'inp'
- */
- uint8_t socks5_server_reply_get_version(const socks5_server_reply_t *inp);
- /** Set the value of the version field of the socks5_server_reply_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_server_reply_set_version(socks5_server_reply_t *inp, uint8_t val);
- /** Return the value of the reply field of the socks5_server_reply_t
- * in 'inp'
- */
- uint8_t socks5_server_reply_get_reply(const socks5_server_reply_t *inp);
- /** Set the value of the reply field of the socks5_server_reply_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_server_reply_set_reply(socks5_server_reply_t *inp, uint8_t val);
- /** Return the value of the reserved field of the
- * socks5_server_reply_t in 'inp'
- */
- uint8_t socks5_server_reply_get_reserved(const socks5_server_reply_t *inp);
- /** Set the value of the reserved field of the socks5_server_reply_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_server_reply_set_reserved(socks5_server_reply_t *inp, uint8_t val);
- /** Return the value of the atype field of the socks5_server_reply_t
- * in 'inp'
- */
- uint8_t socks5_server_reply_get_atype(const socks5_server_reply_t *inp);
- /** Set the value of the atype field of the socks5_server_reply_t in
- * 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_server_reply_set_atype(socks5_server_reply_t *inp, uint8_t val);
- /** Return the value of the bind_addr_ipv4 field of the
- * socks5_server_reply_t in 'inp'
- */
- uint32_t socks5_server_reply_get_bind_addr_ipv4(const socks5_server_reply_t *inp);
- /** Set the value of the bind_addr_ipv4 field of the
- * socks5_server_reply_t in 'inp' to 'val'. Return 0 on success;
- * return -1 and set the error code on 'inp' on failure.
- */
- int socks5_server_reply_set_bind_addr_ipv4(socks5_server_reply_t *inp, uint32_t val);
- /** Return the (constant) length of the array holding the
- * bind_addr_ipv6 field of the socks5_server_reply_t in 'inp'.
- */
- size_t socks5_server_reply_getlen_bind_addr_ipv6(const socks5_server_reply_t *inp);
- /** Return the element at position 'idx' of the fixed array field
- * bind_addr_ipv6 of the socks5_server_reply_t in 'inp'.
- */
- uint8_t socks5_server_reply_get_bind_addr_ipv6(socks5_server_reply_t *inp, size_t idx);
- /** As socks5_server_reply_get_bind_addr_ipv6, but take and return a
- * const pointer
- */
- uint8_t socks5_server_reply_getconst_bind_addr_ipv6(const socks5_server_reply_t *inp, size_t idx);
- /** Change the element at position 'idx' of the fixed array field
- * bind_addr_ipv6 of the socks5_server_reply_t in 'inp', so that it
- * will hold the value 'elt'.
- */
- int socks5_server_reply_set_bind_addr_ipv6(socks5_server_reply_t *inp, size_t idx, uint8_t elt);
- /** Return a pointer to the 16-element array field bind_addr_ipv6 of
- * 'inp'.
- */
- uint8_t * socks5_server_reply_getarray_bind_addr_ipv6(socks5_server_reply_t *inp);
- /** As socks5_server_reply_get_bind_addr_ipv6, but take and return a
- * const pointer
- */
- const uint8_t * socks5_server_reply_getconstarray_bind_addr_ipv6(const socks5_server_reply_t *inp);
- /** Return the value of the bind_addr_domainname field of the
- * socks5_server_reply_t in 'inp'
- */
- struct domainname_st * socks5_server_reply_get_bind_addr_domainname(socks5_server_reply_t *inp);
- /** As socks5_server_reply_get_bind_addr_domainname, but take and
- * return a const pointer
- */
- const struct domainname_st * socks5_server_reply_getconst_bind_addr_domainname(const socks5_server_reply_t *inp);
- /** Set the value of the bind_addr_domainname field of the
- * socks5_server_reply_t in 'inp' to 'val'. Free the old value if any.
- * Steals the referenceto 'val'.Return 0 on success; return -1 and set
- * the error code on 'inp' on failure.
- */
- int socks5_server_reply_set_bind_addr_domainname(socks5_server_reply_t *inp, struct domainname_st *val);
- /** As socks5_server_reply_set_bind_addr_domainname, but does not free
- * the previous value.
- */
- int socks5_server_reply_set0_bind_addr_domainname(socks5_server_reply_t *inp, struct domainname_st *val);
- /** Return the value of the bind_port field of the
- * socks5_server_reply_t in 'inp'
- */
- uint16_t socks5_server_reply_get_bind_port(const socks5_server_reply_t *inp);
- /** Set the value of the bind_port field of the socks5_server_reply_t
- * in 'inp' to 'val'. Return 0 on success; return -1 and set the error
- * code on 'inp' on failure.
- */
- int socks5_server_reply_set_bind_port(socks5_server_reply_t *inp, uint16_t val);
- /** Return a newly allocated tor_extended_socks_auth_request with all
- * elements set to zero.
- */
- tor_extended_socks_auth_request_t *tor_extended_socks_auth_request_new(void);
- /** Release all storage held by the tor_extended_socks_auth_request in
- * 'victim'. (Do nothing if 'victim' is NULL.)
- */
- void tor_extended_socks_auth_request_free(tor_extended_socks_auth_request_t *victim);
- /** Try to parse a tor_extended_socks_auth_request from the buffer in
- * 'input', using up to 'len_in' bytes from the input buffer. On
- * success, return the number of bytes consumed and set *output to the
- * newly allocated tor_extended_socks_auth_request_t. On failure,
- * return -2 if the input appears truncated, and -1 if the input is
- * otherwise invalid.
- */
- ssize_t tor_extended_socks_auth_request_parse(tor_extended_socks_auth_request_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * tor_extended_socks_auth_request in 'obj'. On failure, return a
- * negative value. Note that this value may be an overestimate, and
- * can even be an underestimate for certain unencodeable objects.
- */
- ssize_t tor_extended_socks_auth_request_encoded_len(const tor_extended_socks_auth_request_t *obj);
- /** Try to encode the tor_extended_socks_auth_request from 'input'
- * into the buffer at 'output', using up to 'avail' bytes of the
- * output buffer. On success, return the number of bytes used. On
- * failure, return -2 if the buffer was not long enough, and -1 if the
- * input was invalid.
- */
- ssize_t tor_extended_socks_auth_request_encode(uint8_t *output, size_t avail, const tor_extended_socks_auth_request_t *input);
- /** Check whether the internal state of the
- * tor_extended_socks_auth_request in 'obj' is consistent. Return NULL
- * if it is, and a short message if it is not.
- */
- const char *tor_extended_socks_auth_request_check(const tor_extended_socks_auth_request_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int tor_extended_socks_auth_request_clear_errors(tor_extended_socks_auth_request_t *obj);
- /** Return the value of the version field of the
- * tor_extended_socks_auth_request_t in 'inp'
- */
- uint8_t tor_extended_socks_auth_request_get_version(const tor_extended_socks_auth_request_t *inp);
- /** Set the value of the version field of the
- * tor_extended_socks_auth_request_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int tor_extended_socks_auth_request_set_version(tor_extended_socks_auth_request_t *inp, uint8_t val);
- /** Return the value of the npairs field of the
- * tor_extended_socks_auth_request_t in 'inp'
- */
- uint16_t tor_extended_socks_auth_request_get_npairs(const tor_extended_socks_auth_request_t *inp);
- /** Set the value of the npairs field of the
- * tor_extended_socks_auth_request_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int tor_extended_socks_auth_request_set_npairs(tor_extended_socks_auth_request_t *inp, uint16_t val);
- /** Return the length of the dynamic array holding the pairs field of
- * the tor_extended_socks_auth_request_t in 'inp'.
- */
- size_t tor_extended_socks_auth_request_getlen_pairs(const tor_extended_socks_auth_request_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * pairs of the tor_extended_socks_auth_request_t in 'inp'.
- */
- struct tor_socksauth_keyval_st * tor_extended_socks_auth_request_get_pairs(tor_extended_socks_auth_request_t *inp, size_t idx);
- /** As tor_extended_socks_auth_request_get_pairs, but take and return
- * a const pointer
- */
- const struct tor_socksauth_keyval_st * tor_extended_socks_auth_request_getconst_pairs(const tor_extended_socks_auth_request_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * pairs of the tor_extended_socks_auth_request_t in 'inp', so that it
- * will hold the value 'elt'. Free the previous value, if any.
- */
- int tor_extended_socks_auth_request_set_pairs(tor_extended_socks_auth_request_t *inp, size_t idx, struct tor_socksauth_keyval_st * elt);
- /** As tor_extended_socks_auth_request_set_pairs, but does not free
- * the previous value.
- */
- int tor_extended_socks_auth_request_set0_pairs(tor_extended_socks_auth_request_t *inp, size_t idx, struct tor_socksauth_keyval_st * elt);
- /** Append a new element 'elt' to the dynamic array field pairs of the
- * tor_extended_socks_auth_request_t in 'inp'.
- */
- int tor_extended_socks_auth_request_add_pairs(tor_extended_socks_auth_request_t *inp, struct tor_socksauth_keyval_st * elt);
- /** Return a pointer to the variable-length array field pairs of
- * 'inp'.
- */
- struct tor_socksauth_keyval_st * * tor_extended_socks_auth_request_getarray_pairs(tor_extended_socks_auth_request_t *inp);
- /** As tor_extended_socks_auth_request_get_pairs, but take and return
- * a const pointer
- */
- const struct tor_socksauth_keyval_st * const * tor_extended_socks_auth_request_getconstarray_pairs(const tor_extended_socks_auth_request_t *inp);
- /** Change the length of the variable-length array field pairs of
- * 'inp' to 'newlen'.Fill extra elements with NULL; free removed
- * elements. Return 0 on success; return -1 and set the error code on
- * 'inp' on failure.
- */
- int tor_extended_socks_auth_request_setlen_pairs(tor_extended_socks_auth_request_t *inp, size_t newlen);
- /** Return a newly allocated tor_extended_socks_auth_response with all
- * elements set to zero.
- */
- tor_extended_socks_auth_response_t *tor_extended_socks_auth_response_new(void);
- /** Release all storage held by the tor_extended_socks_auth_response
- * in 'victim'. (Do nothing if 'victim' is NULL.)
- */
- void tor_extended_socks_auth_response_free(tor_extended_socks_auth_response_t *victim);
- /** Try to parse a tor_extended_socks_auth_response from the buffer in
- * 'input', using up to 'len_in' bytes from the input buffer. On
- * success, return the number of bytes consumed and set *output to the
- * newly allocated tor_extended_socks_auth_response_t. On failure,
- * return -2 if the input appears truncated, and -1 if the input is
- * otherwise invalid.
- */
- ssize_t tor_extended_socks_auth_response_parse(tor_extended_socks_auth_response_t **output, const uint8_t *input, const size_t len_in);
- /** Return the number of bytes we expect to need to encode the
- * tor_extended_socks_auth_response in 'obj'. On failure, return a
- * negative value. Note that this value may be an overestimate, and
- * can even be an underestimate for certain unencodeable objects.
- */
- ssize_t tor_extended_socks_auth_response_encoded_len(const tor_extended_socks_auth_response_t *obj);
- /** Try to encode the tor_extended_socks_auth_response from 'input'
- * into the buffer at 'output', using up to 'avail' bytes of the
- * output buffer. On success, return the number of bytes used. On
- * failure, return -2 if the buffer was not long enough, and -1 if the
- * input was invalid.
- */
- ssize_t tor_extended_socks_auth_response_encode(uint8_t *output, size_t avail, const tor_extended_socks_auth_response_t *input);
- /** Check whether the internal state of the
- * tor_extended_socks_auth_response in 'obj' is consistent. Return
- * NULL if it is, and a short message if it is not.
- */
- const char *tor_extended_socks_auth_response_check(const tor_extended_socks_auth_response_t *obj);
- /** Clear any errors that were set on the object 'obj' by its setter
- * functions. Return true iff errors were cleared.
- */
- int tor_extended_socks_auth_response_clear_errors(tor_extended_socks_auth_response_t *obj);
- /** Return the value of the version field of the
- * tor_extended_socks_auth_response_t in 'inp'
- */
- uint8_t tor_extended_socks_auth_response_get_version(const tor_extended_socks_auth_response_t *inp);
- /** Set the value of the version field of the
- * tor_extended_socks_auth_response_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int tor_extended_socks_auth_response_set_version(tor_extended_socks_auth_response_t *inp, uint8_t val);
- /** Return the value of the status field of the
- * tor_extended_socks_auth_response_t in 'inp'
- */
- uint8_t tor_extended_socks_auth_response_get_status(const tor_extended_socks_auth_response_t *inp);
- /** Set the value of the status field of the
- * tor_extended_socks_auth_response_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int tor_extended_socks_auth_response_set_status(tor_extended_socks_auth_response_t *inp, uint8_t val);
- /** Return the value of the npairs field of the
- * tor_extended_socks_auth_response_t in 'inp'
- */
- uint16_t tor_extended_socks_auth_response_get_npairs(const tor_extended_socks_auth_response_t *inp);
- /** Set the value of the npairs field of the
- * tor_extended_socks_auth_response_t in 'inp' to 'val'. Return 0 on
- * success; return -1 and set the error code on 'inp' on failure.
- */
- int tor_extended_socks_auth_response_set_npairs(tor_extended_socks_auth_response_t *inp, uint16_t val);
- /** Return the length of the dynamic array holding the pairs field of
- * the tor_extended_socks_auth_response_t in 'inp'.
- */
- size_t tor_extended_socks_auth_response_getlen_pairs(const tor_extended_socks_auth_response_t *inp);
- /** Return the element at position 'idx' of the dynamic array field
- * pairs of the tor_extended_socks_auth_response_t in 'inp'.
- */
- struct tor_socksauth_keyval_st * tor_extended_socks_auth_response_get_pairs(tor_extended_socks_auth_response_t *inp, size_t idx);
- /** As tor_extended_socks_auth_response_get_pairs, but take and return
- * a const pointer
- */
- const struct tor_socksauth_keyval_st * tor_extended_socks_auth_response_getconst_pairs(const tor_extended_socks_auth_response_t *inp, size_t idx);
- /** Change the element at position 'idx' of the dynamic array field
- * pairs of the tor_extended_socks_auth_response_t in 'inp', so that
- * it will hold the value 'elt'. Free the previous value, if any.
- */
- int tor_extended_socks_auth_response_set_pairs(tor_extended_socks_auth_response_t *inp, size_t idx, struct tor_socksauth_keyval_st * elt);
- /** As tor_extended_socks_auth_response_set_pairs, but does not free
- * the previous value.
- */
- int tor_extended_socks_auth_response_set0_pairs(tor_extended_socks_auth_response_t *inp, size_t idx, struct tor_socksauth_keyval_st * elt);
- /** Append a new element 'elt' to the dynamic array field pairs of the
- * tor_extended_socks_auth_response_t in 'inp'.
- */
- int tor_extended_socks_auth_response_add_pairs(tor_extended_socks_auth_response_t *inp, struct tor_socksauth_keyval_st * elt);
- /** Return a pointer to the variable-length array field pairs of
- * 'inp'.
- */
- struct tor_socksauth_keyval_st * * tor_extended_socks_auth_response_getarray_pairs(tor_extended_socks_auth_response_t *inp);
- /** As tor_extended_socks_auth_response_get_pairs, but take and return
- * a const pointer
- */
- const struct tor_socksauth_keyval_st * const * tor_extended_socks_auth_response_getconstarray_pairs(const tor_extended_socks_auth_response_t *inp);
- /** Change the length of the variable-length array field pairs of
- * 'inp' to 'newlen'.Fill extra elements with NULL; free removed
- * elements. Return 0 on success; return -1 and set the error code on
- * 'inp' on failure.
- */
- int tor_extended_socks_auth_response_setlen_pairs(tor_extended_socks_auth_response_t *inp, size_t newlen);
- #endif
|