[kdbus] Make SipHash function as a private utility function to kdbus
[platform/upstream/glib.git] / gio / gsocketcontrolmessage.h
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright © 2009 Codethink Limited
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published
7  * by the Free Software Foundation; either version 2 of the licence or (at
8  * your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17  *
18  * Authors: Ryan Lortie <desrt@desrt.ca>
19  */
20
21 #ifndef __G_SOCKET_CONTROL_MESSAGE_H__
22 #define __G_SOCKET_CONTROL_MESSAGE_H__
23
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
26 #endif
27
28 #include <gio/giotypes.h>
29
30 G_BEGIN_DECLS
31
32 #define G_TYPE_SOCKET_CONTROL_MESSAGE                       (g_socket_control_message_get_type ())
33 #define G_SOCKET_CONTROL_MESSAGE(inst)                      (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
34                                                              G_TYPE_SOCKET_CONTROL_MESSAGE,                          \
35                                                              GSocketControlMessage))
36 #define G_SOCKET_CONTROL_MESSAGE_CLASS(class)               (G_TYPE_CHECK_CLASS_CAST ((class),                       \
37                                                              G_TYPE_SOCKET_CONTROL_MESSAGE,                          \
38                                                              GSocketControlMessageClass))
39 #define G_IS_SOCKET_CONTROL_MESSAGE(inst)                   (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
40                                                              G_TYPE_SOCKET_CONTROL_MESSAGE))
41 #define G_IS_SOCKET_CONTROL_MESSAGE_CLASS(class)            (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
42                                                              G_TYPE_SOCKET_CONTROL_MESSAGE))
43 #define G_SOCKET_CONTROL_MESSAGE_GET_CLASS(inst)            (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
44                                                              G_TYPE_SOCKET_CONTROL_MESSAGE,                          \
45                                                              GSocketControlMessageClass))
46
47 typedef struct _GSocketControlMessagePrivate                GSocketControlMessagePrivate;
48 typedef struct _GSocketControlMessageClass                  GSocketControlMessageClass;
49
50 /**
51  * GSocketControlMessageClass:
52  * @get_size: gets the size of the message.
53  * @get_level: gets the protocol of the message.
54  * @get_type: gets the protocol specific type of the message.
55  * @serialize: Writes out the message data.
56  * @deserialize: Tries to deserialize a message.
57  **/
58
59 struct _GSocketControlMessageClass
60 {
61   GObjectClass parent_class;
62
63   gsize                  (* get_size)  (GSocketControlMessage  *message);
64   int                    (* get_level) (GSocketControlMessage  *message);
65   int                    (* get_type)  (GSocketControlMessage  *message);
66   void                   (* serialize) (GSocketControlMessage  *message,
67                                         gpointer                data);
68   GSocketControlMessage *(* deserialize) (int                   level,
69                                           int                   type,
70                                           gsize                 size,
71                                           gpointer              data);
72
73   /*< private >*/
74
75   /* Padding for future expansion */
76   void (*_g_reserved1) (void);
77   void (*_g_reserved2) (void);
78   void (*_g_reserved3) (void);
79   void (*_g_reserved4) (void);
80   void (*_g_reserved5) (void);
81 };
82
83 struct _GSocketControlMessage
84 {
85   GObject parent_instance;
86   GSocketControlMessagePrivate *priv;
87 };
88
89 GLIB_AVAILABLE_IN_ALL
90 GType                  g_socket_control_message_get_type     (void) G_GNUC_CONST;
91 GLIB_AVAILABLE_IN_ALL
92 gsize                  g_socket_control_message_get_size     (GSocketControlMessage *message);
93 GLIB_AVAILABLE_IN_ALL
94 int                    g_socket_control_message_get_level    (GSocketControlMessage *message);
95 GLIB_AVAILABLE_IN_ALL
96 int                    g_socket_control_message_get_msg_type (GSocketControlMessage *message);
97 GLIB_AVAILABLE_IN_ALL
98 void                   g_socket_control_message_serialize    (GSocketControlMessage *message,
99                                                               gpointer               data);
100 GLIB_AVAILABLE_IN_ALL
101 GSocketControlMessage *g_socket_control_message_deserialize  (int                    level,
102                                                               int                    type,
103                                                               gsize                  size,
104                                                               gpointer               data);
105
106
107 G_END_DECLS
108
109 #endif /* __G_SOCKET_CONTROL_MESSAGE_H__ */