/work/obj-fuzz/dist/include/nsIUDPSocket.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/netwerk/base/nsIUDPSocket.idl |
3 | | */ |
4 | | |
5 | | #ifndef __gen_nsIUDPSocket_h__ |
6 | | #define __gen_nsIUDPSocket_h__ |
7 | | |
8 | | |
9 | | #ifndef __gen_nsISupports_h__ |
10 | | #include "nsISupports.h" |
11 | | #endif |
12 | | |
13 | | #include "js/Value.h" |
14 | | |
15 | | #include "js/GCAnnotations.h" |
16 | | |
17 | | /* For IDL files that don't want to include root IDL files. */ |
18 | | #ifndef NS_NO_VTABLE |
19 | | #define NS_NO_VTABLE |
20 | | #endif |
21 | | class nsINetAddr; /* forward declaration */ |
22 | | |
23 | | class nsIUDPSocketListener; /* forward declaration */ |
24 | | |
25 | | class nsIUDPMessage; /* forward declaration */ |
26 | | |
27 | | class nsISocketTransport; /* forward declaration */ |
28 | | |
29 | | class nsIOutputStream; /* forward declaration */ |
30 | | |
31 | | class nsIInputStream; /* forward declaration */ |
32 | | |
33 | | class nsIPrincipal; /* forward declaration */ |
34 | | |
35 | | #include "nsTArrayForwardDeclare.h" |
36 | | namespace mozilla { |
37 | | namespace net { |
38 | | union NetAddr; |
39 | | } |
40 | | } |
41 | | |
42 | | /* starting interface: nsIUDPSocket */ |
43 | | #define NS_IUDPSOCKET_IID_STR "d423bf4e-4499-40cf-bc03-153e2bf206d1" |
44 | | |
45 | | #define NS_IUDPSOCKET_IID \ |
46 | | {0xd423bf4e, 0x4499, 0x40cf, \ |
47 | | { 0xbc, 0x03, 0x15, 0x3e, 0x2b, 0xf2, 0x06, 0xd1 }} |
48 | | |
49 | | class NS_NO_VTABLE nsIUDPSocket : public nsISupports { |
50 | | public: |
51 | | |
52 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPSOCKET_IID) |
53 | | |
54 | | /* [optional_argc] void init (in long aPort, in boolean aLoopbackOnly, in nsIPrincipal aPrincipal, [optional] in boolean aAddressReuse); */ |
55 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) = 0; |
56 | | |
57 | | /* [optional_argc] void init2 (in AUTF8String aAddr, in long aPort, in nsIPrincipal aPrincipal, [optional] in boolean aAddressReuse); */ |
58 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Init2(const nsACString& aAddr, int32_t aPort, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) = 0; |
59 | | |
60 | | /* [noscript,optional_argc] void initWithAddress ([const] in NetAddrPtr aAddr, in nsIPrincipal aPrincipal, [optional] in boolean aAddressReuse); */ |
61 | | NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr * aAddr, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) = 0; |
62 | | |
63 | | /* void close (); */ |
64 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Close(void) = 0; |
65 | | |
66 | | /* void asyncListen (in nsIUDPSocketListener aListener); */ |
67 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener) = 0; |
68 | | |
69 | | /* void connect ([const] in NetAddrPtr aAddr); */ |
70 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Connect(const mozilla::net::NetAddr * aAddr) = 0; |
71 | | |
72 | | /* readonly attribute nsINetAddr localAddr; */ |
73 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetLocalAddr(nsINetAddr **aLocalAddr) = 0; |
74 | | |
75 | | /* readonly attribute long port; */ |
76 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetPort(int32_t *aPort) = 0; |
77 | | |
78 | | /* [noscript] NetAddr getAddress (); */ |
79 | | NS_IMETHOD GetAddress(mozilla::net::NetAddr * _retval) = 0; |
80 | | |
81 | | /* unsigned long send (in AUTF8String host, in unsigned short port, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */ |
82 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) = 0; |
83 | | |
84 | | /* unsigned long sendWithAddr (in nsINetAddr addr, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */ |
85 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) = 0; |
86 | | |
87 | | /* [noscript] unsigned long sendWithAddress ([const] in NetAddrPtr addr, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */ |
88 | | NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) = 0; |
89 | | |
90 | | /* void sendBinaryStream (in AUTF8String host, in unsigned short port, in nsIInputStream stream); */ |
91 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) = 0; |
92 | | |
93 | | /* void sendBinaryStreamWithAddress ([const] in NetAddrPtr addr, in nsIInputStream stream); */ |
94 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SendBinaryStreamWithAddress(const mozilla::net::NetAddr * addr, nsIInputStream *stream) = 0; |
95 | | |
96 | | /* void joinMulticast (in AUTF8String addr, [optional] in AUTF8String iface); */ |
97 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD JoinMulticast(const nsACString& addr, const nsACString& iface) = 0; |
98 | | |
99 | | /* [noscript] void joinMulticastAddr ([const] in NetAddr addr, [const, optional] in NetAddrPtr iface); */ |
100 | | NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) = 0; |
101 | | |
102 | | /* void leaveMulticast (in AUTF8String addr, [optional] in AUTF8String iface); */ |
103 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD LeaveMulticast(const nsACString& addr, const nsACString& iface) = 0; |
104 | | |
105 | | /* [noscript] void leaveMulticastAddr ([const] in NetAddr addr, [const, optional] in NetAddrPtr iface); */ |
106 | | NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) = 0; |
107 | | |
108 | | /* attribute boolean multicastLoopback; */ |
109 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback) = 0; |
110 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback) = 0; |
111 | | |
112 | | /* attribute AUTF8String multicastInterface; */ |
113 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetMulticastInterface(nsACString& aMulticastInterface) = 0; |
114 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetMulticastInterface(const nsACString& aMulticastInterface) = 0; |
115 | | |
116 | | /* [noscript] attribute NetAddr multicastInterfaceAddr; */ |
117 | | NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr * aMulticastInterfaceAddr) = 0; |
118 | | NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr) = 0; |
119 | | |
120 | | /* [noscript] attribute long recvBufferSize; */ |
121 | | NS_IMETHOD GetRecvBufferSize(int32_t *aRecvBufferSize) = 0; |
122 | | NS_IMETHOD SetRecvBufferSize(int32_t aRecvBufferSize) = 0; |
123 | | |
124 | | /* [noscript] attribute long sendBufferSize; */ |
125 | | NS_IMETHOD GetSendBufferSize(int32_t *aSendBufferSize) = 0; |
126 | | NS_IMETHOD SetSendBufferSize(int32_t aSendBufferSize) = 0; |
127 | | |
128 | | }; |
129 | | |
130 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPSocket, NS_IUDPSOCKET_IID) |
131 | | |
132 | | /* Use this macro when declaring classes that implement this interface. */ |
133 | | #define NS_DECL_NSIUDPSOCKET \ |
134 | | NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override; \ |
135 | | NS_IMETHOD Init2(const nsACString& aAddr, int32_t aPort, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override; \ |
136 | | NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr * aAddr, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override; \ |
137 | | NS_IMETHOD Close(void) override; \ |
138 | | NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener) override; \ |
139 | | NS_IMETHOD Connect(const mozilla::net::NetAddr * aAddr) override; \ |
140 | | NS_IMETHOD GetLocalAddr(nsINetAddr **aLocalAddr) override; \ |
141 | | NS_IMETHOD GetPort(int32_t *aPort) override; \ |
142 | | NS_IMETHOD GetAddress(mozilla::net::NetAddr * _retval) override; \ |
143 | | NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override; \ |
144 | | NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override; \ |
145 | | NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override; \ |
146 | | NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) override; \ |
147 | | NS_IMETHOD SendBinaryStreamWithAddress(const mozilla::net::NetAddr * addr, nsIInputStream *stream) override; \ |
148 | | NS_IMETHOD JoinMulticast(const nsACString& addr, const nsACString& iface) override; \ |
149 | | NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) override; \ |
150 | | NS_IMETHOD LeaveMulticast(const nsACString& addr, const nsACString& iface) override; \ |
151 | | NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) override; \ |
152 | | NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback) override; \ |
153 | | NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback) override; \ |
154 | | NS_IMETHOD GetMulticastInterface(nsACString& aMulticastInterface) override; \ |
155 | | NS_IMETHOD SetMulticastInterface(const nsACString& aMulticastInterface) override; \ |
156 | | NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr * aMulticastInterfaceAddr) override; \ |
157 | | NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr) override; \ |
158 | | NS_IMETHOD GetRecvBufferSize(int32_t *aRecvBufferSize) override; \ |
159 | | NS_IMETHOD SetRecvBufferSize(int32_t aRecvBufferSize) override; \ |
160 | | NS_IMETHOD GetSendBufferSize(int32_t *aSendBufferSize) override; \ |
161 | | NS_IMETHOD SetSendBufferSize(int32_t aSendBufferSize) override; |
162 | | |
163 | | /* Use this macro when declaring the members of this interface when the |
164 | | class doesn't implement the interface. This is useful for forwarding. */ |
165 | | #define NS_DECL_NON_VIRTUAL_NSIUDPSOCKET \ |
166 | | nsresult Init(int32_t aPort, bool aLoopbackOnly, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc); \ |
167 | | nsresult Init2(const nsACString& aAddr, int32_t aPort, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc); \ |
168 | | nsresult InitWithAddress(const mozilla::net::NetAddr * aAddr, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc); \ |
169 | | nsresult Close(void); \ |
170 | | nsresult AsyncListen(nsIUDPSocketListener *aListener); \ |
171 | | nsresult Connect(const mozilla::net::NetAddr * aAddr); \ |
172 | | nsresult GetLocalAddr(nsINetAddr **aLocalAddr); \ |
173 | | nsresult GetPort(int32_t *aPort); \ |
174 | | nsresult GetAddress(mozilla::net::NetAddr * _retval); \ |
175 | | nsresult Send(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval); \ |
176 | | nsresult SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval); \ |
177 | | nsresult SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval); \ |
178 | | nsresult SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream); \ |
179 | | nsresult SendBinaryStreamWithAddress(const mozilla::net::NetAddr * addr, nsIInputStream *stream); \ |
180 | | nsresult JoinMulticast(const nsACString& addr, const nsACString& iface); \ |
181 | | nsresult JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface); \ |
182 | | nsresult LeaveMulticast(const nsACString& addr, const nsACString& iface); \ |
183 | | nsresult LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface); \ |
184 | | nsresult GetMulticastLoopback(bool *aMulticastLoopback); \ |
185 | | nsresult SetMulticastLoopback(bool aMulticastLoopback); \ |
186 | | nsresult GetMulticastInterface(nsACString& aMulticastInterface); \ |
187 | | nsresult SetMulticastInterface(const nsACString& aMulticastInterface); \ |
188 | | nsresult GetMulticastInterfaceAddr(mozilla::net::NetAddr * aMulticastInterfaceAddr); \ |
189 | | nsresult SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr); \ |
190 | | nsresult GetRecvBufferSize(int32_t *aRecvBufferSize); \ |
191 | | nsresult SetRecvBufferSize(int32_t aRecvBufferSize); \ |
192 | | nsresult GetSendBufferSize(int32_t *aSendBufferSize); \ |
193 | | nsresult SetSendBufferSize(int32_t aSendBufferSize); |
194 | | |
195 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
196 | | #define NS_FORWARD_NSIUDPSOCKET(_to) \ |
197 | | NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override { return _to Init(aPort, aLoopbackOnly, aPrincipal, aAddressReuse, _argc); } \ |
198 | | NS_IMETHOD Init2(const nsACString& aAddr, int32_t aPort, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override { return _to Init2(aAddr, aPort, aPrincipal, aAddressReuse, _argc); } \ |
199 | | NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr * aAddr, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override { return _to InitWithAddress(aAddr, aPrincipal, aAddressReuse, _argc); } \ |
200 | | NS_IMETHOD Close(void) override { return _to Close(); } \ |
201 | | NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener) override { return _to AsyncListen(aListener); } \ |
202 | | NS_IMETHOD Connect(const mozilla::net::NetAddr * aAddr) override { return _to Connect(aAddr); } \ |
203 | | NS_IMETHOD GetLocalAddr(nsINetAddr **aLocalAddr) override { return _to GetLocalAddr(aLocalAddr); } \ |
204 | | NS_IMETHOD GetPort(int32_t *aPort) override { return _to GetPort(aPort); } \ |
205 | | NS_IMETHOD GetAddress(mozilla::net::NetAddr * _retval) override { return _to GetAddress(_retval); } \ |
206 | | NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override { return _to Send(host, port, data, dataLength, _retval); } \ |
207 | | NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override { return _to SendWithAddr(addr, data, dataLength, _retval); } \ |
208 | | NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override { return _to SendWithAddress(addr, data, dataLength, _retval); } \ |
209 | | NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) override { return _to SendBinaryStream(host, port, stream); } \ |
210 | | NS_IMETHOD SendBinaryStreamWithAddress(const mozilla::net::NetAddr * addr, nsIInputStream *stream) override { return _to SendBinaryStreamWithAddress(addr, stream); } \ |
211 | | NS_IMETHOD JoinMulticast(const nsACString& addr, const nsACString& iface) override { return _to JoinMulticast(addr, iface); } \ |
212 | | NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) override { return _to JoinMulticastAddr(addr, iface); } \ |
213 | | NS_IMETHOD LeaveMulticast(const nsACString& addr, const nsACString& iface) override { return _to LeaveMulticast(addr, iface); } \ |
214 | | NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) override { return _to LeaveMulticastAddr(addr, iface); } \ |
215 | | NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback) override { return _to GetMulticastLoopback(aMulticastLoopback); } \ |
216 | | NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback) override { return _to SetMulticastLoopback(aMulticastLoopback); } \ |
217 | | NS_IMETHOD GetMulticastInterface(nsACString& aMulticastInterface) override { return _to GetMulticastInterface(aMulticastInterface); } \ |
218 | | NS_IMETHOD SetMulticastInterface(const nsACString& aMulticastInterface) override { return _to SetMulticastInterface(aMulticastInterface); } \ |
219 | | NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr * aMulticastInterfaceAddr) override { return _to GetMulticastInterfaceAddr(aMulticastInterfaceAddr); } \ |
220 | | NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr) override { return _to SetMulticastInterfaceAddr(aMulticastInterfaceAddr); } \ |
221 | | NS_IMETHOD GetRecvBufferSize(int32_t *aRecvBufferSize) override { return _to GetRecvBufferSize(aRecvBufferSize); } \ |
222 | | NS_IMETHOD SetRecvBufferSize(int32_t aRecvBufferSize) override { return _to SetRecvBufferSize(aRecvBufferSize); } \ |
223 | | NS_IMETHOD GetSendBufferSize(int32_t *aSendBufferSize) override { return _to GetSendBufferSize(aSendBufferSize); } \ |
224 | | NS_IMETHOD SetSendBufferSize(int32_t aSendBufferSize) override { return _to SetSendBufferSize(aSendBufferSize); } |
225 | | |
226 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
227 | | #define NS_FORWARD_SAFE_NSIUDPSOCKET(_to) \ |
228 | | NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aPort, aLoopbackOnly, aPrincipal, aAddressReuse, _argc); } \ |
229 | | NS_IMETHOD Init2(const nsACString& aAddr, int32_t aPort, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init2(aAddr, aPort, aPrincipal, aAddressReuse, _argc); } \ |
230 | | NS_IMETHOD InitWithAddress(const mozilla::net::NetAddr * aAddr, nsIPrincipal *aPrincipal, bool aAddressReuse, uint8_t _argc) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithAddress(aAddr, aPrincipal, aAddressReuse, _argc); } \ |
231 | | NS_IMETHOD Close(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \ |
232 | | NS_IMETHOD AsyncListen(nsIUDPSocketListener *aListener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncListen(aListener); } \ |
233 | | NS_IMETHOD Connect(const mozilla::net::NetAddr * aAddr) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Connect(aAddr); } \ |
234 | | NS_IMETHOD GetLocalAddr(nsINetAddr **aLocalAddr) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLocalAddr(aLocalAddr); } \ |
235 | | NS_IMETHOD GetPort(int32_t *aPort) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPort(aPort); } \ |
236 | | NS_IMETHOD GetAddress(mozilla::net::NetAddr * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAddress(_retval); } \ |
237 | | NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Send(host, port, data, dataLength, _retval); } \ |
238 | | NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendWithAddr(addr, data, dataLength, _retval); } \ |
239 | | NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *data, uint32_t dataLength, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendWithAddress(addr, data, dataLength, _retval); } \ |
240 | | NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendBinaryStream(host, port, stream); } \ |
241 | | NS_IMETHOD SendBinaryStreamWithAddress(const mozilla::net::NetAddr * addr, nsIInputStream *stream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendBinaryStreamWithAddress(addr, stream); } \ |
242 | | NS_IMETHOD JoinMulticast(const nsACString& addr, const nsACString& iface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->JoinMulticast(addr, iface); } \ |
243 | | NS_IMETHOD JoinMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->JoinMulticastAddr(addr, iface); } \ |
244 | | NS_IMETHOD LeaveMulticast(const nsACString& addr, const nsACString& iface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->LeaveMulticast(addr, iface); } \ |
245 | | NS_IMETHOD LeaveMulticastAddr(const mozilla::net::NetAddr addr, const mozilla::net::NetAddr * iface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->LeaveMulticastAddr(addr, iface); } \ |
246 | | NS_IMETHOD GetMulticastLoopback(bool *aMulticastLoopback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMulticastLoopback(aMulticastLoopback); } \ |
247 | | NS_IMETHOD SetMulticastLoopback(bool aMulticastLoopback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMulticastLoopback(aMulticastLoopback); } \ |
248 | | NS_IMETHOD GetMulticastInterface(nsACString& aMulticastInterface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMulticastInterface(aMulticastInterface); } \ |
249 | | NS_IMETHOD SetMulticastInterface(const nsACString& aMulticastInterface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMulticastInterface(aMulticastInterface); } \ |
250 | | NS_IMETHOD GetMulticastInterfaceAddr(mozilla::net::NetAddr * aMulticastInterfaceAddr) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMulticastInterfaceAddr(aMulticastInterfaceAddr); } \ |
251 | | NS_IMETHOD SetMulticastInterfaceAddr(mozilla::net::NetAddr aMulticastInterfaceAddr) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMulticastInterfaceAddr(aMulticastInterfaceAddr); } \ |
252 | | NS_IMETHOD GetRecvBufferSize(int32_t *aRecvBufferSize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRecvBufferSize(aRecvBufferSize); } \ |
253 | | NS_IMETHOD SetRecvBufferSize(int32_t aRecvBufferSize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRecvBufferSize(aRecvBufferSize); } \ |
254 | | NS_IMETHOD GetSendBufferSize(int32_t *aSendBufferSize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSendBufferSize(aSendBufferSize); } \ |
255 | | NS_IMETHOD SetSendBufferSize(int32_t aSendBufferSize) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSendBufferSize(aSendBufferSize); } |
256 | | |
257 | | |
258 | | /* starting interface: nsIUDPSocketListener */ |
259 | | #define NS_IUDPSOCKETLISTENER_IID_STR "2e4b5dd3-7358-4281-b81f-10c62ef39cb5" |
260 | | |
261 | | #define NS_IUDPSOCKETLISTENER_IID \ |
262 | | {0x2e4b5dd3, 0x7358, 0x4281, \ |
263 | | { 0xb8, 0x1f, 0x10, 0xc6, 0x2e, 0xf3, 0x9c, 0xb5 }} |
264 | | |
265 | | class NS_NO_VTABLE nsIUDPSocketListener : public nsISupports { |
266 | | public: |
267 | | |
268 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPSOCKETLISTENER_IID) |
269 | | |
270 | | /* void onPacketReceived (in nsIUDPSocket aSocket, in nsIUDPMessage aMessage); */ |
271 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage) = 0; |
272 | | |
273 | | /* void onStopListening (in nsIUDPSocket aSocket, in nsresult aStatus); */ |
274 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus) = 0; |
275 | | |
276 | | }; |
277 | | |
278 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPSocketListener, NS_IUDPSOCKETLISTENER_IID) |
279 | | |
280 | | /* Use this macro when declaring classes that implement this interface. */ |
281 | | #define NS_DECL_NSIUDPSOCKETLISTENER \ |
282 | | NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage) override; \ |
283 | | NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus) override; |
284 | | |
285 | | /* Use this macro when declaring the members of this interface when the |
286 | | class doesn't implement the interface. This is useful for forwarding. */ |
287 | | #define NS_DECL_NON_VIRTUAL_NSIUDPSOCKETLISTENER \ |
288 | | nsresult OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage); \ |
289 | | nsresult OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus); |
290 | | |
291 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
292 | | #define NS_FORWARD_NSIUDPSOCKETLISTENER(_to) \ |
293 | | NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage) override { return _to OnPacketReceived(aSocket, aMessage); } \ |
294 | | NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus) override { return _to OnStopListening(aSocket, aStatus); } |
295 | | |
296 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
297 | | #define NS_FORWARD_SAFE_NSIUDPSOCKETLISTENER(_to) \ |
298 | 0 | NS_IMETHOD OnPacketReceived(nsIUDPSocket *aSocket, nsIUDPMessage *aMessage) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnPacketReceived(aSocket, aMessage); } \ |
299 | 0 | NS_IMETHOD OnStopListening(nsIUDPSocket *aSocket, nsresult aStatus) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStopListening(aSocket, aStatus); } |
300 | | |
301 | | |
302 | | /* starting interface: nsIUDPMessage */ |
303 | | #define NS_IUDPMESSAGE_IID_STR "afdc743f-9cc0-40d8-b442-695dc54bbb74" |
304 | | |
305 | | #define NS_IUDPMESSAGE_IID \ |
306 | | {0xafdc743f, 0x9cc0, 0x40d8, \ |
307 | | { 0xb4, 0x42, 0x69, 0x5d, 0xc5, 0x4b, 0xbb, 0x74 }} |
308 | | |
309 | | class NS_NO_VTABLE nsIUDPMessage : public nsISupports { |
310 | | public: |
311 | | |
312 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPMESSAGE_IID) |
313 | | |
314 | | /* readonly attribute nsINetAddr fromAddr; */ |
315 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetFromAddr(nsINetAddr **aFromAddr) = 0; |
316 | | |
317 | | /* readonly attribute ACString data; */ |
318 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetData(nsACString& aData) = 0; |
319 | | |
320 | | /* readonly attribute nsIOutputStream outputStream; */ |
321 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetOutputStream(nsIOutputStream **aOutputStream) = 0; |
322 | | |
323 | | /* [implicit_jscontext] readonly attribute jsval rawData; */ |
324 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData) = 0; |
325 | | |
326 | | /* [noscript,nostdcall,notxpcom] Uint8TArrayRef getDataAsTArray (); */ |
327 | | virtual FallibleTArray<uint8_t> & GetDataAsTArray(void) = 0; |
328 | | |
329 | | }; |
330 | | |
331 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPMessage, NS_IUDPMESSAGE_IID) |
332 | | |
333 | | /* Use this macro when declaring classes that implement this interface. */ |
334 | | #define NS_DECL_NSIUDPMESSAGE \ |
335 | | NS_IMETHOD GetFromAddr(nsINetAddr **aFromAddr) override; \ |
336 | | NS_IMETHOD GetData(nsACString& aData) override; \ |
337 | | NS_IMETHOD GetOutputStream(nsIOutputStream **aOutputStream) override; \ |
338 | | NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData) override; \ |
339 | | virtual FallibleTArray<uint8_t> & GetDataAsTArray(void) override; |
340 | | |
341 | | /* Use this macro when declaring the members of this interface when the |
342 | | class doesn't implement the interface. This is useful for forwarding. */ |
343 | | #define NS_DECL_NON_VIRTUAL_NSIUDPMESSAGE \ |
344 | | nsresult GetFromAddr(nsINetAddr **aFromAddr); \ |
345 | | nsresult GetData(nsACString& aData); \ |
346 | | nsresult GetOutputStream(nsIOutputStream **aOutputStream); \ |
347 | | nsresult GetRawData(JSContext* cx, JS::MutableHandleValue aRawData); \ |
348 | | FallibleTArray<uint8_t> & GetDataAsTArray(void); |
349 | | |
350 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
351 | | #define NS_FORWARD_NSIUDPMESSAGE(_to) \ |
352 | | NS_IMETHOD GetFromAddr(nsINetAddr **aFromAddr) override { return _to GetFromAddr(aFromAddr); } \ |
353 | | NS_IMETHOD GetData(nsACString& aData) override { return _to GetData(aData); } \ |
354 | | NS_IMETHOD GetOutputStream(nsIOutputStream **aOutputStream) override { return _to GetOutputStream(aOutputStream); } \ |
355 | | NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData) override { return _to GetRawData(cx, aRawData); } \ |
356 | | virtual FallibleTArray<uint8_t> & GetDataAsTArray(void) override { return _to GetDataAsTArray(); } |
357 | | |
358 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
359 | | #define NS_FORWARD_SAFE_NSIUDPMESSAGE(_to) \ |
360 | | NS_IMETHOD GetFromAddr(nsINetAddr **aFromAddr) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFromAddr(aFromAddr); } \ |
361 | | NS_IMETHOD GetData(nsACString& aData) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetData(aData); } \ |
362 | | NS_IMETHOD GetOutputStream(nsIOutputStream **aOutputStream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOutputStream(aOutputStream); } \ |
363 | | NS_IMETHOD GetRawData(JSContext* cx, JS::MutableHandleValue aRawData) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRawData(cx, aRawData); } \ |
364 | | virtual FallibleTArray<uint8_t> & GetDataAsTArray(void) override; |
365 | | |
366 | | |
367 | | #endif /* __gen_nsIUDPSocket_h__ */ |