/* This file is part of Eclat. Copyright (C) 2012 Sergey Poznyakoff. Eclat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Eclat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eclat. If not, see . */ #include void hmac_sha1(const void *text, size_t textlen, const void *key, size_t keylen, void *digest); void urlencode(const char *input, size_t len, char **poutput, size_t *poutlen); void eclat_base64_encode(const unsigned char *input, size_t input_len, unsigned char **output, size_t *output_len); int eclat_base64_decode(const unsigned char *input, size_t input_len, unsigned char **output, size_t *output_len); struct ec2_param { char *name; char *value; }; #define EC2_API_VERSION "2012-08-15" #define EC2_QF_HTTPS 0x01 #define EC2_QF_POST 0x02 struct ec2_query { int flags; /* Composed from EC2_QF_* bits */ char *endpoint; /* endpoint */ char *uri; /* URI without parameters */ struct grecs_symtab *params; /* Query parameters */ char *signature; unsigned long ttl; /* Time-to-live in seconds */ }; struct ec2_query *eclat_query_create(int flags, const char *endpoint, const char *uri); void eclat_query_free(struct ec2_query *); int eclat_query_signature(struct ec2_query *req, char *secret); char *eclat_query_to_url(struct ec2_query *req, char **post_params); void eclat_query_encode(struct ec2_query *q);