// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.RtspServer {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class RTSPAddressPool : GLib.Object {

		public RTSPAddressPool (IntPtr raw) : base(raw) {}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_rtsp_address_pool_new();

		public RTSPAddressPool () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (RTSPAddressPool)) {
				CreateNativeObject (new string [0], new GLib.Value[0]);
				return;
			}
			Raw = gst_rtsp_address_pool_new();
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("_gst_reserved"
							, GLib.Object.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
							, null
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_rtsp_address_pool_get_type();

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gst_rtsp_address_pool_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_rtsp_address_pool_acquire_address(IntPtr raw, int flags, int n_ports);

		public Gst.RtspServer.RTSPAddress AcquireAddress(Gst.RtspServer.RTSPAddressFlags flags, int n_ports) {
			IntPtr raw_ret = gst_rtsp_address_pool_acquire_address(Handle, (int) flags, n_ports);
			Gst.RtspServer.RTSPAddress ret = Gst.RtspServer.RTSPAddress.New (raw_ret);
			return ret;
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_rtsp_address_pool_add_range(IntPtr raw, IntPtr min_address, IntPtr max_address, ushort min_port, ushort max_port, byte ttl);

		public bool AddRange(string min_address, string max_address, ushort min_port, ushort max_port, byte ttl) {
			IntPtr native_min_address = GLib.Marshaller.StringToPtrGStrdup (min_address);
			IntPtr native_max_address = GLib.Marshaller.StringToPtrGStrdup (max_address);
			bool raw_ret = gst_rtsp_address_pool_add_range(Handle, native_min_address, native_max_address, min_port, max_port, ttl);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_min_address);
			GLib.Marshaller.Free (native_max_address);
			return ret;
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_address_pool_clear(IntPtr raw);

		public void Clear() {
			gst_rtsp_address_pool_clear(Handle);
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_address_pool_dump(IntPtr raw);

		public void Dump() {
			gst_rtsp_address_pool_dump(Handle);
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_rtsp_address_pool_has_unicast_addresses(IntPtr raw);

		public bool HasUnicastAddresses { 
			get {
				bool raw_ret = gst_rtsp_address_pool_has_unicast_addresses(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_rtsp_address_pool_reserve_address(IntPtr raw, IntPtr ip_address, uint port, uint n_ports, uint ttl, IntPtr address);

		public Gst.RtspServer.RTSPAddressPoolResult ReserveAddress(string ip_address, uint port, uint n_ports, uint ttl, out Gst.RtspServer.RTSPAddress address) {
			IntPtr native_ip_address = GLib.Marshaller.StringToPtrGStrdup (ip_address);
			IntPtr native_address = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.RtspServer.RTSPAddress)));
			int raw_ret = gst_rtsp_address_pool_reserve_address(Handle, native_ip_address, port, n_ports, ttl, native_address);
			Gst.RtspServer.RTSPAddressPoolResult ret = (Gst.RtspServer.RTSPAddressPoolResult) raw_ret;
			GLib.Marshaller.Free (native_ip_address);
			address = Gst.RtspServer.RTSPAddress.New (native_address);
			Marshal.FreeHGlobal (native_address);
			return ret;
		}


		static RTSPAddressPool ()
		{
			GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
		}

		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("priv"
							, GLib.Object.abi_info.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, null
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
							, "priv"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
