Combine generator subdirectories into one.
[wrappi.git] / lib / proto-xdr.h
1 /* wrappi
2  * Copyright (C) 2011-2012 Red Hat Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18
19 #ifndef WRAPPI_PROTO_XDR_H_
20 #define WRAPPI_PROTO_XDR_H_
21
22 #include <stdint.h>
23 #include <rpc/types.h>
24 #include <rpc/xdr.h>
25
26 #define WRAP_INT_PROTO_MAGIC        0x57524150 /* 'W' 'R' 'A' 'P' */
27 #define WRAP_INT_PROTOCOL           1
28 #define WRAP_INT_PROTO_TYPE_REQUEST 1
29 #define WRAP_INT_PROTO_TYPE_REPLY   2
30 #define WRAP_INT_PROTO_TYPE_ERROR   3
31
32 struct wrap_int_message_header {
33   uint32_t magic;               /* WRAP_INT_PROTO_MAGIC */
34   uint32_t protocol;            /* protocol version */
35   uint32_t serial;              /* message serial number */
36   char *proc;                   /* procedure name */
37   uint32_t type;                /* WRAP_INT_PROTO_TYPE_* */
38 };
39
40 struct wrap_int_message_error {
41   char *error_message;          /* error message */
42   char *error_errno;            /* errno as string, eg. "EINVAL", or empty */
43   char *error_func;             /* function where error occurred */
44 };
45
46 extern bool_t wrap_int_xdr_message_header (XDR *, struct wrap_int_message_header *);
47 extern bool_t wrap_int_xdr_message_error (XDR *, struct wrap_int_message_error *);
48
49 #endif /* WRAPPI_PROTO_XDR_H_ */