2 * Copyright (C) <2005> Wim Taymans <wim@fluendo.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library 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.
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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_NETBUFFER_H__
21 #define __GST_NETBUFFER_H__
27 typedef struct _GstNetBuffer GstNetBuffer;
28 typedef struct _GstNetBufferClass GstNetBufferClass;
30 #define GST_TYPE_NETBUFFER (gst_netbuffer_get_type())
31 #define GST_IS_NETBUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NETBUFFER))
32 #define GST_IS_NETBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_NETBUFFER))
33 #define GST_NETBUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_NETBUFFER, GstNetBufferClass))
34 #define GST_NETBUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NETBUFFER, GstNetBuffer))
35 #define GST_NETBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_NETBUFFER, GstNetBufferClass))
37 /* buffer for use in network sources and sinks.
39 * It contains the source or destination address of the buffer.
56 gpointer _gst_reserved[GST_PADDING];
59 struct _GstNetBuffer {
66 gpointer _gst_reserved[GST_PADDING];
69 struct _GstNetBufferClass {
70 GstBufferClass buffer_class;
73 gpointer _gst_reserved[GST_PADDING];
76 /* creating buffers */
77 GType gst_netbuffer_get_type (void);
79 GstNetBuffer* gst_netbuffer_new (void);
81 /* address operations */
82 void gst_netaddress_set_ip4_address (GstNetAddress *nadd, guint32 address, guint16 port);
83 void gst_netaddress_set_ip6_address (GstNetAddress *nadd, guint8 address[16], guint16 port);
85 GstNetType gst_netaddress_get_net_type (GstNetAddress *nadd);
86 gboolean gst_netaddress_get_ip4_address (GstNetAddress *nadd, guint32 *address, guint16 *port);
87 gboolean gst_netaddress_get_ip6_address (GstNetAddress *nadd, guint8 address[16], guint16 *port);
91 #endif /* __GST_NETBUFFER_H__ */