michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */ michael@0: michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: include protocol PNecko; michael@0: michael@0: include "mozilla/net/NeckoMessageUtils.h"; michael@0: include "mozilla/net/DNS.h"; michael@0: include "prio.h"; michael@0: michael@0: using mozilla::net::NetAddr from "mozilla/net/DNS.h"; michael@0: using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; michael@0: michael@0: struct UDPError { michael@0: nsCString message; michael@0: nsCString filename; michael@0: uint32_t lineNumber; michael@0: uint32_t columnNumber; michael@0: }; michael@0: michael@0: struct UDPMessage { michael@0: nsCString fromAddr; michael@0: uint16_t port; michael@0: uint8_t[] data; michael@0: }; michael@0: michael@0: struct UDPAddressInfo { michael@0: nsCString local; michael@0: uint16_t port; michael@0: }; michael@0: michael@0: struct UDPSendResult { michael@0: nsresult value; michael@0: }; michael@0: michael@0: union UDPCallbackData { michael@0: void_t; michael@0: UDPMessage; michael@0: UDPAddressInfo; michael@0: UDPSendResult; michael@0: UDPError; michael@0: }; michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: //------------------------------------------------------------------- michael@0: protocol PUDPSocket michael@0: { michael@0: manager PNecko; michael@0: michael@0: parent: michael@0: Data(uint8_t[] data, nsCString remoteAddress, uint16_t port); michael@0: DataWithAddress(uint8_t[] data, NetAddr addr); michael@0: Close(); michael@0: RequestDelete(); michael@0: michael@0: child: michael@0: Callback(nsCString type, UDPCallbackData data, nsCString aState); michael@0: __delete__(); michael@0: }; michael@0: michael@0: michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: