/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIUDPSocket.idl
 */

#ifndef __gen_nsIUDPSocket_h__
#define __gen_nsIUDPSocket_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#include "js/Value.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsINetAddr; /* forward declaration */

class nsIUDPSocketListener; /* forward declaration */

class nsIUDPMessage; /* forward declaration */

class nsISocketTransport; /* forward declaration */

class nsIOutputStream; /* forward declaration */

#include "nsTArrayForwardDeclare.h"
namespace mozilla {
namespace net {
union NetAddr;
}
}

/* starting interface:    nsIUDPSocket */
#define NS_IUDPSOCKET_IID_STR "3240f793-80fa-4088-987a-9c7378f0ac88"

#define NS_IUDPSOCKET_IID \
  {0x3240f793, 0x80fa, 0x4088, \
    { 0x98, 0x7a, 0x9c, 0x73, 0x78, 0xf0, 0xac, 0x88 }}

class NS_NO_VTABLE nsIUDPSocket : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPSOCKET_IID)

  /* void init (in long aPort, in boolean aLoopbackOnly); */
  NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly) = 0;

  /* [noscript] void initWithAddress ([const] in NetAddrPtr aAddr); */
  NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr *aAddr) = 0;

  /* void close (); */
  NS_IMETHOD Close(void) = 0;

  /* void asyncListen (in nsIUDPSocketListener aListener); */
  NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener) = 0;

  /* readonly attribute long port; */
  NS_IMETHOD GetPort(int32_t *aPort) = 0;

  /* [noscript] NetAddr getAddress (); */
  NS_IMETHOD GetAddress(mozilla::net::NetAddr *_retval) = 0;

  /* unsigned long send (in AUTF8String host, in unsigned short port, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */
  NS_IMETHOD Send(const nsACString & host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) = 0;

  /* unsigned long sendWithAddr (in nsINetAddr addr, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */
  NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) = 0;

  /* [noscript] unsigned long sendWithAddress ([const] in NetAddrPtr addr, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) = 0;

  /* void joinMulticast (in AUTF8String addr, [optional] in AUTF8String iface); */
  NS_IMETHOD JoinMulticast(const nsACString & addr, const nsACString & iface) = 0;

  /* [noscript] void joinMulticastAddr ([const] in NetAddr addr, [const, optional] in NetAddrPtr iface); */
  NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface) = 0;

  /* void leaveMulticast (in AUTF8String addr, [optional] in AUTF8String iface); */
  NS_IMETHOD LeaveMulticast(const nsACString & addr, const nsACString & iface) = 0;

  /* [noscript] void leaveMulticastAddr ([const] in NetAddr addr, [const, optional] in NetAddrPtr iface); */
  NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface) = 0;

  /* attribute boolean multicastLoopback; */
  NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback) = 0;
  NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback) = 0;

  /* attribute AUTF8String multicastInterface; */
  NS_IMETHOD GetMulticastInterface(nsACString & aMulticastInterface) = 0;
  NS_IMETHOD SetMulticastInterface(const nsACString & aMulticastInterface) = 0;

  /* [noscript] attribute NetAddr multicastInterfaceAddr; */
  NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr *aMulticastInterfaceAddr) = 0;
  NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPSocket, NS_IUDPSOCKET_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIUDPSOCKET \
  NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly); \
  NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr *aAddr); \
  NS_IMETHOD Close(void); \
  NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener); \
  NS_IMETHOD GetPort(int32_t *aPort); \
  NS_IMETHOD GetAddress(mozilla::net::NetAddr *_retval); \
  NS_IMETHOD Send(const nsACString & host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval); \
  NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval); \
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval); \
  NS_IMETHOD JoinMulticast(const nsACString & addr, const nsACString & iface); \
  NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface); \
  NS_IMETHOD LeaveMulticast(const nsACString & addr, const nsACString & iface); \
  NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface); \
  NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback); \
  NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback); \
  NS_IMETHOD GetMulticastInterface(nsACString & aMulticastInterface); \
  NS_IMETHOD SetMulticastInterface(const nsACString & aMulticastInterface); \
  NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr *aMulticastInterfaceAddr); \
  NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIUDPSOCKET(_to) \
  NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly) { return _to Init(aPort, aLoopbackOnly); } \
  NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr *aAddr) { return _to InitWithAddress(aAddr); } \
  NS_IMETHOD Close(void) { return _to Close(); } \
  NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener) { return _to AsyncListen(aListener); } \
  NS_IMETHOD GetPort(int32_t *aPort) { return _to GetPort(aPort); } \
  NS_IMETHOD GetAddress(mozilla::net::NetAddr *_retval) { return _to GetAddress(_retval); } \
  NS_IMETHOD Send(const nsACString & host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) { return _to Send(host, port, data, dataLength, _retval); } \
  NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) { return _to SendWithAddr(addr, data, dataLength, _retval); } \
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) { return _to SendWithAddress(addr, data, dataLength, _retval); } \
  NS_IMETHOD JoinMulticast(const nsACString & addr, const nsACString & iface) { return _to JoinMulticast(addr, iface); } \
  NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface) { return _to JoinMulticastAddr(addr, iface); } \
  NS_IMETHOD LeaveMulticast(const nsACString & addr, const nsACString & iface) { return _to LeaveMulticast(addr, iface); } \
  NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface) { return _to LeaveMulticastAddr(addr, iface); } \
  NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback) { return _to GetMulticastLoopback(aMulticastLoopback); } \
  NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback) { return _to SetMulticastLoopback(aMulticastLoopback); } \
  NS_IMETHOD GetMulticastInterface(nsACString & aMulticastInterface) { return _to GetMulticastInterface(aMulticastInterface); } \
  NS_IMETHOD SetMulticastInterface(const nsACString & aMulticastInterface) { return _to SetMulticastInterface(aMulticastInterface); } \
  NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr *aMulticastInterfaceAddr) { return _to GetMulticastInterfaceAddr(aMulticastInterfaceAddr); } \
  NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr) { return _to SetMulticastInterfaceAddr(aMulticastInterfaceAddr); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIUDPSOCKET(_to) \
  NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aPort, aLoopbackOnly); } \
  NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr *aAddr) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithAddress(aAddr); } \
  NS_IMETHOD Close(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
  NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncListen(aListener); } \
  NS_IMETHOD GetPort(int32_t *aPort) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPort(aPort); } \
  NS_IMETHOD GetAddress(mozilla::net::NetAddr *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAddress(_retval); } \
  NS_IMETHOD Send(const nsACString & host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Send(host, port, data, dataLength, _retval); } \
  NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SendWithAddr(addr, data, dataLength, _retval); } \
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SendWithAddress(addr, data, dataLength, _retval); } \
  NS_IMETHOD JoinMulticast(const nsACString & addr, const nsACString & iface) { return !_to ? NS_ERROR_NULL_POINTER : _to->JoinMulticast(addr, iface); } \
  NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface) { return !_to ? NS_ERROR_NULL_POINTER : _to->JoinMulticastAddr(addr, iface); } \
  NS_IMETHOD LeaveMulticast(const nsACString & addr, const nsACString & iface) { return !_to ? NS_ERROR_NULL_POINTER : _to->LeaveMulticast(addr, iface); } \
  NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface) { return !_to ? NS_ERROR_NULL_POINTER : _to->LeaveMulticastAddr(addr, iface); } \
  NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMulticastLoopback(aMulticastLoopback); } \
  NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMulticastLoopback(aMulticastLoopback); } \
  NS_IMETHOD GetMulticastInterface(nsACString & aMulticastInterface) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMulticastInterface(aMulticastInterface); } \
  NS_IMETHOD SetMulticastInterface(const nsACString & aMulticastInterface) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMulticastInterface(aMulticastInterface); } \
  NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr *aMulticastInterfaceAddr) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMulticastInterfaceAddr(aMulticastInterfaceAddr); } \
  NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMulticastInterfaceAddr(aMulticastInterfaceAddr); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsUDPSocket : public nsIUDPSocket
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIUDPSOCKET

  nsUDPSocket();

private:
  ~nsUDPSocket();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsUDPSocket, nsIUDPSocket)

nsUDPSocket::nsUDPSocket()
{
  /* member initializers and constructor code */
}

nsUDPSocket::~nsUDPSocket()
{
  /* destructor code */
}

/* void init (in long aPort, in boolean aLoopbackOnly); */
NS_IMETHODIMP nsUDPSocket::Init(int32_t aPort, bool aLoopbackOnly)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void initWithAddress ([const] in NetAddrPtr aAddr); */
NS_IMETHODIMP nsUDPSocket::InitWithAddress(const mozilla::net::NetAddr *aAddr)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void close (); */
NS_IMETHODIMP nsUDPSocket::Close()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void asyncListen (in nsIUDPSocketListener aListener); */
NS_IMETHODIMP nsUDPSocket::AsyncListen(nsIUDPSocketListener *aListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute long port; */
NS_IMETHODIMP nsUDPSocket::GetPort(int32_t *aPort)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] NetAddr getAddress (); */
NS_IMETHODIMP nsUDPSocket::GetAddress(mozilla::net::NetAddr *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* unsigned long send (in AUTF8String host, in unsigned short port, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */
NS_IMETHODIMP nsUDPSocket::Send(const nsACString & host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* unsigned long sendWithAddr (in nsINetAddr addr, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */
NS_IMETHODIMP nsUDPSocket::SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] unsigned long sendWithAddress ([const] in NetAddrPtr addr, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */
NS_IMETHODIMP nsUDPSocket::SendWithAddress(const mozilla::net::NetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void joinMulticast (in AUTF8String addr, [optional] in AUTF8String iface); */
NS_IMETHODIMP nsUDPSocket::JoinMulticast(const nsACString & addr, const nsACString & iface)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void joinMulticastAddr ([const] in NetAddr addr, [const, optional] in NetAddrPtr iface); */
NS_IMETHODIMP nsUDPSocket::JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void leaveMulticast (in AUTF8String addr, [optional] in AUTF8String iface); */
NS_IMETHODIMP nsUDPSocket::LeaveMulticast(const nsACString & addr, const nsACString & iface)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void leaveMulticastAddr ([const] in NetAddr addr, [const, optional] in NetAddrPtr iface); */
NS_IMETHODIMP nsUDPSocket::LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr *iface)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean multicastLoopback; */
NS_IMETHODIMP nsUDPSocket::GetMulticastLoopback(bool *aMulticastLoopback)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsUDPSocket::SetMulticastLoopback(bool aMulticastLoopback)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute AUTF8String multicastInterface; */
NS_IMETHODIMP nsUDPSocket::GetMulticastInterface(nsACString & aMulticastInterface)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsUDPSocket::SetMulticastInterface(const nsACString & aMulticastInterface)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] attribute NetAddr multicastInterfaceAddr; */
NS_IMETHODIMP nsUDPSocket::GetMulticastInterfaceAddr(mozilla::net::NetAddr *aMulticastInterfaceAddr)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsUDPSocket::SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    nsIUDPSocketListener */
#define NS_IUDPSOCKETLISTENER_IID_STR "2e4b5dd3-7358-4281-b81f-10c62ef39cb5"

#define NS_IUDPSOCKETLISTENER_IID \
  {0x2e4b5dd3, 0x7358, 0x4281, \
    { 0xb8, 0x1f, 0x10, 0xc6, 0x2e, 0xf3, 0x9c, 0xb5 }}

class NS_NO_VTABLE nsIUDPSocketListener : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPSOCKETLISTENER_IID)

  /* void onPacketReceived (in nsIUDPSocket aSocket, in nsIUDPMessage aMessage); */
  NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage) = 0;

  /* void onStopListening (in nsIUDPSocket aSocket, in nsresult aStatus); */
  NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPSocketListener, NS_IUDPSOCKETLISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIUDPSOCKETLISTENER \
  NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage); \
  NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIUDPSOCKETLISTENER(_to) \
  NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage) { return _to OnPacketReceived(aSocket, aMessage); } \
  NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus) { return _to OnStopListening(aSocket, aStatus); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIUDPSOCKETLISTENER(_to) \
  NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnPacketReceived(aSocket, aMessage); } \
  NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStopListening(aSocket, aStatus); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsUDPSocketListener : public nsIUDPSocketListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIUDPSOCKETLISTENER

  nsUDPSocketListener();

private:
  ~nsUDPSocketListener();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsUDPSocketListener, nsIUDPSocketListener)

nsUDPSocketListener::nsUDPSocketListener()
{
  /* member initializers and constructor code */
}

nsUDPSocketListener::~nsUDPSocketListener()
{
  /* destructor code */
}

/* void onPacketReceived (in nsIUDPSocket aSocket, in nsIUDPMessage aMessage); */
NS_IMETHODIMP nsUDPSocketListener::OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onStopListening (in nsIUDPSocket aSocket, in nsresult aStatus); */
NS_IMETHODIMP nsUDPSocketListener::OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    nsIUDPMessage */
#define NS_IUDPMESSAGE_IID_STR "afdc743f-9cc0-40d8-b442-695dc54bbb74"

#define NS_IUDPMESSAGE_IID \
  {0xafdc743f, 0x9cc0, 0x40d8, \
    { 0xb4, 0x42, 0x69, 0x5d, 0xc5, 0x4b, 0xbb, 0x74 }}

class NS_NO_VTABLE nsIUDPMessage : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPMESSAGE_IID)

  /* readonly attribute nsINetAddr fromAddr; */
  NS_IMETHOD GetFromAddr(nsINetAddr * *aFromAddr) = 0;

  /* readonly attribute ACString data; */
  NS_IMETHOD GetData(nsACString & aData) = 0;

  /* readonly attribute nsIOutputStream outputStream; */
  NS_IMETHOD GetOutputStream(nsIOutputStream * *aOutputStream) = 0;

  /* [implicit_jscontext] readonly attribute jsval rawData; */
  NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData) = 0;

  /* [noscript,nostdcall,notxpcom] Uint8TArrayRef getDataAsTArray (); */
  virtual FallibleTArray<uint8_t> & GetDataAsTArray(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPMessage, NS_IUDPMESSAGE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIUDPMESSAGE \
  NS_IMETHOD GetFromAddr(nsINetAddr * *aFromAddr); \
  NS_IMETHOD GetData(nsACString & aData); \
  NS_IMETHOD GetOutputStream(nsIOutputStream * *aOutputStream); \
  NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData); \
  virtual FallibleTArray<uint8_t> & GetDataAsTArray(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIUDPMESSAGE(_to) \
  NS_IMETHOD GetFromAddr(nsINetAddr * *aFromAddr) { return _to GetFromAddr(aFromAddr); } \
  NS_IMETHOD GetData(nsACString & aData) { return _to GetData(aData); } \
  NS_IMETHOD GetOutputStream(nsIOutputStream * *aOutputStream) { return _to GetOutputStream(aOutputStream); } \
  NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData) { return _to GetRawData(cx, aRawData); } \
  virtual FallibleTArray<uint8_t> & GetDataAsTArray(void) { return _to GetDataAsTArray(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIUDPMESSAGE(_to) \
  NS_IMETHOD GetFromAddr(nsINetAddr * *aFromAddr) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFromAddr(aFromAddr); } \
  NS_IMETHOD GetData(nsACString & aData) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetData(aData); } \
  NS_IMETHOD GetOutputStream(nsIOutputStream * *aOutputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOutputStream(aOutputStream); } \
  NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRawData(cx, aRawData); } \
  virtual FallibleTArray<uint8_t> & GetDataAsTArray(void); 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsUDPMessage : public nsIUDPMessage
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIUDPMESSAGE

  nsUDPMessage();

private:
  ~nsUDPMessage();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsUDPMessage, nsIUDPMessage)

nsUDPMessage::nsUDPMessage()
{
  /* member initializers and constructor code */
}

nsUDPMessage::~nsUDPMessage()
{
  /* destructor code */
}

/* readonly attribute nsINetAddr fromAddr; */
NS_IMETHODIMP nsUDPMessage::GetFromAddr(nsINetAddr * *aFromAddr)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute ACString data; */
NS_IMETHODIMP nsUDPMessage::GetData(nsACString & aData)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIOutputStream outputStream; */
NS_IMETHODIMP nsUDPMessage::GetOutputStream(nsIOutputStream * *aOutputStream)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [implicit_jscontext] readonly attribute jsval rawData; */
NS_IMETHODIMP nsUDPMessage::GetRawData(JSContext* cx, JS::MutableHandleValue aRawData)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript,nostdcall,notxpcom] Uint8TArrayRef getDataAsTArray (); */
FallibleTArray<uint8_t> & nsUDPMessage::GetDataAsTArray()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_nsIUDPSocket_h__ */
