Open SCAP Library
|
00001 /* 00002 * Copyright 2009 Red Hat Inc., Durham, North Carolina. 00003 * All Rights Reserved. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * Authors: 00020 * "Daniel Kopecek" <dkopecek@redhat.com> 00021 */ 00022 00023 #pragma once 00024 #ifndef SEAP_PACKET_H 00025 #define SEAP_PACKET_H 00026 00027 #include <seap-message.h> 00028 #include <seap-command.h> 00029 #include <seap-error.h> 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 typedef struct SEAP_packet SEAP_packet_t; 00036 00037 #define SEAP_PACKET_INV 0x00 /* Invalid packet */ 00038 #define SEAP_PACKET_MSG 0x01 /* Message packet */ 00039 #define SEAP_PACKET_ERR 0x02 /* Error packet */ 00040 #define SEAP_PACKET_CMD 0x03 /* Command packet */ 00041 #define SEAP_PACKET_RAW 0x04 /* Raw packet */ 00042 00043 SEAP_packet_t *SEAP_packet_new (void); 00044 void SEAP_packet_free (SEAP_packet_t *packet); 00045 00046 void *SEAP_packet_settype (SEAP_packet_t *packet, uint8_t type); 00047 uint8_t SEAP_packet_gettype (SEAP_packet_t *packet); 00048 00049 SEAP_msg_t *SEAP_packet_msg (SEAP_packet_t *packet); 00050 SEAP_cmd_t *SEAP_packet_cmd (SEAP_packet_t *packet); 00051 SEAP_err_t *SEAP_packet_err (SEAP_packet_t *packet); 00052 00053 int SEAP_packet_recv (SEAP_CTX_t *ctx, int sd, SEAP_packet_t **packet); 00054 int SEAP_packet_recv_bytype (SEAP_CTX_t *ctx, int sd, SEAP_packet_t **packet, uint8_t type); 00055 int SEAP_packet_send (SEAP_CTX_t *ctx, int sd, SEAP_packet_t *packet); 00056 int SEAP_packet_enqueue (SEAP_CTX_t *ctx, int sd, SEAP_packet_t *packet); 00057 00058 #ifdef __cplusplus 00059 } 00060 #endif 00061 00062 #endif /* SEAP_PACKET_H */