1/*
2	logging.h
3
4	Message logging plugin and stat collector for webserver.
5
6	Register the plugin with:
7		soap_register_plugin(soap, logging);
8
9	Change logging destinations:
10		soap_set_logging_inbound(struct soap*, FILE*);
11		soap_set_logging_outbound(struct soap*, FILE*);
12
13	Obtain stats (sent and recv octet count):
14		soap_get_logging_stats(soap, size_t *sent, size_t *recv);
15
16gSOAP XML Web services tools
17Copyright (C) 2000-2008, Robert van Engelen, Genivia Inc., All Rights Reserved.
18This part of the software is released under one of the following licenses:
19GPL, the gSOAP public license, or Genivia's license for commercial use.
20--------------------------------------------------------------------------------
21gSOAP public license.
22
23The contents of this file are subject to the gSOAP Public License Version 1.3
24(the "License"); you may not use this file except in compliance with the
25License. You may obtain a copy of the License at
26http://www.cs.fsu.edu/~engelen/soaplicense.html
27Software distributed under the License is distributed on an "AS IS" basis,
28WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
29for the specific language governing rights and limitations under the License.
30
31The Initial Developer of the Original Code is Robert A. van Engelen.
32Copyright (C) 2000-2008, Robert van Engelen, Genivia Inc., All Rights Reserved.
33--------------------------------------------------------------------------------
34GPL license.
35
36This program is free software; you can redistribute it and/or modify it under
37the terms of the GNU General Public License as published by the Free Software
38Foundation; either version 2 of the License, or (at your option) any later
39version.
40
41This program is distributed in the hope that it will be useful, but WITHOUT ANY
42WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
43PARTICULAR PURPOSE. See the GNU General Public License for more details.
44
45You should have received a copy of the GNU General Public License along with
46this program; if not, write to the Free Software Foundation, Inc., 59 Temple
47Place, Suite 330, Boston, MA 02111-1307 USA
48
49Author contact information:
50engelen@genivia.com / engelen@acm.org
51
52This program is released under the GPL with the additional exemption that
53compiling, linking, and/or using OpenSSL is allowed.
54--------------------------------------------------------------------------------
55A commercial use license is available from Genivia, Inc., contact@genivia.com
56--------------------------------------------------------------------------------
57*/
58
59#ifndef LOGGING_H
60#define LOGGING_H
61
62#include "stdsoap2.h"
63
64#ifdef __cplusplus
65extern "C" {
66#endif
67
68#define LOGGING_ID "LOGGING-1.3"
69
70extern const char logging_id[];
71
72struct logging_data
73{
74  FILE *inbound;
75  FILE *outbound;
76  size_t stat_sent;
77  size_t stat_recv;
78  int (*fsend)(struct soap*, const char*, size_t); /* to save and use send callback */
79  size_t (*frecv)(struct soap*, char*, size_t); /* to save and use recv callback */
80};
81
82int logging(struct soap *soap, struct soap_plugin *plugin, void *arg);
83void soap_set_logging_inbound(struct soap *soap, FILE *fd);
84void soap_set_logging_outbound(struct soap *soap, FILE *fd);
85void soap_get_logging_stats(struct soap *soap, size_t *sent, size_t *recv);
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif
92