/* zentific-poll: statistics collection daemon for Zentific * Copyright (C) 2007, 2008 * Steven Maresca, Justin Demaris, * and Zentific LLC * * All rights reserved. * Use is subject to license terms. * * Please visit http://zentific.com for news and updates * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. */ #ifndef SSL_SEND_H_ #define SSL_SEND_H_ #include #include #include /** * Sends a message over an SSL encrypted connection to the given destination * * @param char* message The message to send * @param char* destination Where to send the message (e.g. zentific.com:443) * @param char* response Pointer to string to hold the reply * @param int length The max length to place into response (including '\0') * @param char* trust Where to load the .pem for trusted certs * @param int ignore_trust_error 0 to fail on trust errors, 1 to ignore them * @param int fallback 0 to fail on SSL fail, 1 to use plaintext if SSL fail. * @return int 0 on success, error code otherwise */ int ssl_send(char *message, char *destination, char *response, int length, char *trust, int ignore_trust_error, int fallback); /** * Sends a message to the given destination without using SSL encryption * @param char* message The message to send * @param char* destination Where to send the message (e.g. zentific.com:443) * @param char* response Pointer to string to hold the reply * @param int length The max length to place into response (including '\0') */ int plaintext_send(char *message, char *destination, char *response, int length); #endif /*SSL_SEND_H_*/