diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-02-13 14:21:08 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-02-13 14:58:04 +0100 |
commit | 9c03cc118c748f6ed2ffbda83ee7ba37cc34738d (patch) | |
tree | 5042054da76bb998ca61b743ea74019305e3ab83 | |
parent | 3217c7eef266b2a99d67545abf8eb443d6124e07 (diff) | |
download | c-ares-9c03cc118c748f6ed2ffbda83ee7ba37cc34738d.tar.gz c-ares-9c03cc118c748f6ed2ffbda83ee7ba37cc34738d.tar.bz2 c-ares-9c03cc118c748f6ed2ffbda83ee7ba37cc34738d.zip |
ares__generate_new_id: moved to ares_query.c
... and ares__rc4 is turned into a local static function.
-rw-r--r-- | ares_init.c | 7 | ||||
-rw-r--r-- | ares_private.h | 1 | ||||
-rw-r--r-- | ares_query.c | 9 |
3 files changed, 8 insertions, 9 deletions
diff --git a/ares_init.c b/ares_init.c index aab1a50..ddcc4f9 100644 --- a/ares_init.c +++ b/ares_init.c @@ -1944,13 +1944,6 @@ static int init_id_key(rc4_key* key,int key_data_len) return ARES_SUCCESS; } -unsigned short ares__generate_new_id(rc4_key* key) -{ - unsigned short r=0; - ares__rc4(key, (unsigned char *)&r, sizeof(r)); - return r; -} - void ares_set_local_ip4(ares_channel channel, unsigned int local_ip) { channel->local_ip4 = local_ip; diff --git a/ares_private.h b/ares_private.h index ea91b7f..ab5be5a 100644 --- a/ares_private.h +++ b/ares_private.h @@ -318,7 +318,6 @@ long ares__timeoffset(struct timeval *now, struct timeval *check); /* returns ARES_SUCCESS if library has been initialized */ int ares_library_initialized(void); -void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len); void ares__send_query(ares_channel channel, struct query *query, struct timeval *now); void ares__close_sockets(ares_channel channel, struct server_state *server); diff --git a/ares_query.c b/ares_query.c index 31084da..4bc9c25 100644 --- a/ares_query.c +++ b/ares_query.c @@ -39,7 +39,7 @@ struct qquery { static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen); -void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len) +static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len) { unsigned char x; unsigned char y; @@ -101,6 +101,13 @@ static unsigned short generate_unique_id(ares_channel channel) return (unsigned short)id; } +unsigned short ares__generate_new_id(rc4_key* key) +{ + unsigned short r=0; + rc4(key, (unsigned char *)&r, sizeof(r)); + return r; +} + void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg) { |