1 /* 2 * Copyright (C) 2015 Cisco Systems, Inc. and/or its affiliates. All rights reserved. 3 * Copyright (C) 2009-2010 Sourcefire, Inc. 4 * 5 * Author: aCaB, Mickey Sola 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as 9 * published by the Free Software Foundation. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301, USA. 20 */ 21 22 #ifndef ONAS_COM_H 23 #define ONAS_COM_H 24 25 #if HAVE_CONFIG_H 26 #include "clamav-config.h" 27 #endif 28 29 #if HAVE_SYS_PARAM_H 30 #include <sys/param.h> 31 #endif 32 33 #include "misc.h" 34 35 struct onas_rcvln { 36 char buf[PATH_MAX + 1024]; 37 int sockd; 38 CURL *curl; 39 CURLcode curlcode; 40 size_t retlen; 41 char *curr; 42 char *lnstart; 43 }; 44 45 int onas_sendln(CURL *curl, const void *line, size_t len, int64_t timeout_ms); 46 void onas_recvlninit(struct onas_rcvln *s, CURL *curl, int sockd); 47 int onas_recvln(struct onas_rcvln *rcv_data, char **ret_bol, char **ret_eol, int64_t timeout_ms); 48 int onas_fd_recvln(struct onas_rcvln *rcv_data, char **ret_bol, char **ret_eol, int64_t timeout_ms); 49 50 #endif 51