Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/nsIUDPSocketChild.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /src/mozilla-central/dom/network/interfaces/nsIUDPSocketChild.idl
3
 */
4
5
#ifndef __gen_nsIUDPSocketChild_h__
6
#define __gen_nsIUDPSocketChild_h__
7
8
9
#ifndef __gen_nsISupports_h__
10
#include "nsISupports.h"
11
#endif
12
13
#ifndef __gen_nsINetAddr_h__
14
#include "nsINetAddr.h"
15
#endif
16
17
#include "js/GCAnnotations.h"
18
19
/* For IDL files that don't want to include root IDL files. */
20
#ifndef NS_NO_VTABLE
21
#define NS_NO_VTABLE
22
#endif
23
class nsIUDPSocketInternal; /* forward declaration */
24
25
class nsIInputStream; /* forward declaration */
26
27
class nsIPrincipal; /* forward declaration */
28
29
class nsIEventTarget; /* forward declaration */
30
31
namespace mozilla {
32
namespace net {
33
union NetAddr;
34
}
35
}
36
37
/* starting interface:    nsIUDPSocketChild */
38
#define NS_IUDPSOCKETCHILD_IID_STR "1e6ad73b-6c05-4d78-9a88-2d357b88f58b"
39
40
#define NS_IUDPSOCKETCHILD_IID \
41
  {0x1e6ad73b, 0x6c05, 0x4d78, \
42
    { 0x9a, 0x88, 0x2d, 0x35, 0x7b, 0x88, 0xf5, 0x8b }}
43
44
class NS_NO_VTABLE nsIUDPSocketChild : public nsISupports {
45
 public:
46
47
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPSOCKETCHILD_IID)
48
49
  /* readonly attribute unsigned short localPort; */
50
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetLocalPort(uint16_t *aLocalPort) = 0;
51
52
  /* readonly attribute AUTF8String localAddress; */
53
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetLocalAddress(nsACString& aLocalAddress) = 0;
54
55
  /* attribute AUTF8String filterName; */
56
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetFilterName(nsACString& aFilterName) = 0;
57
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetFilterName(const nsACString& aFilterName) = 0;
58
59
  /* [noscript] void setBackgroundSpinsEvents (); */
60
  NS_IMETHOD SetBackgroundSpinsEvents(void) = 0;
61
62
  /* void bind (in nsIUDPSocketInternal socket, in nsIPrincipal principal, in AUTF8String host, in unsigned short port, in bool addressReuse, in bool loopback, in uint32_t recvBufferSize, in uint32_t sendBufferSize, [optional] in nsIEventTarget mainThreadTarget); */
63
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Bind(nsIUDPSocketInternal *socket, nsIPrincipal *principal, const nsACString& host, uint16_t port, bool addressReuse, bool loopback, uint32_t recvBufferSize, uint32_t sendBufferSize, nsIEventTarget *mainThreadTarget) = 0;
64
65
  /* void connect (in nsIUDPSocketInternal socket, in AUTF8String host, in unsigned short port); */
66
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Connect(nsIUDPSocketInternal *socket, const nsACString& host, uint16_t port) = 0;
67
68
  /* void send (in AUTF8String host, in unsigned short port, [array, size_is (byteLength), const] in uint8_t bytes, in unsigned long byteLength); */
69
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *bytes, uint32_t byteLength) = 0;
70
71
  /* void sendWithAddr (in nsINetAddr addr, [array, size_is (byteLength), const] in uint8_t bytes, in unsigned long byteLength); */
72
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *bytes, uint32_t byteLength) = 0;
73
74
  /* [noscript] void sendWithAddress ([const] in NetAddrPtr addr, [array, size_is (byteLength), const] in uint8_t bytes, in unsigned long byteLength); */
75
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *bytes, uint32_t byteLength) = 0;
76
77
  /* void sendBinaryStream (in AUTF8String host, in unsigned short port, in nsIInputStream stream); */
78
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) = 0;
79
80
  /* void close (); */
81
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Close(void) = 0;
82
83
  /* void joinMulticast (in AUTF8String multicastAddress, in AUTF8String iface); */
84
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD JoinMulticast(const nsACString& multicastAddress, const nsACString& iface) = 0;
85
86
  /* void leaveMulticast (in AUTF8String multicastAddress, in AUTF8String iface); */
87
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD LeaveMulticast(const nsACString& multicastAddress, const nsACString& iface) = 0;
88
89
};
90
91
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPSocketChild, NS_IUDPSOCKETCHILD_IID)
92
93
/* Use this macro when declaring classes that implement this interface. */
94
#define NS_DECL_NSIUDPSOCKETCHILD \
95
  NS_IMETHOD GetLocalPort(uint16_t *aLocalPort) override; \
96
  NS_IMETHOD GetLocalAddress(nsACString& aLocalAddress) override; \
97
  NS_IMETHOD GetFilterName(nsACString& aFilterName) override; \
98
  NS_IMETHOD SetFilterName(const nsACString& aFilterName) override; \
99
  NS_IMETHOD SetBackgroundSpinsEvents(void) override; \
100
  NS_IMETHOD Bind(nsIUDPSocketInternal *socket, nsIPrincipal *principal, const nsACString& host, uint16_t port, bool addressReuse, bool loopback, uint32_t recvBufferSize, uint32_t sendBufferSize, nsIEventTarget *mainThreadTarget) override; \
101
  NS_IMETHOD Connect(nsIUDPSocketInternal *socket, const nsACString& host, uint16_t port) override; \
102
  NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *bytes, uint32_t byteLength) override; \
103
  NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *bytes, uint32_t byteLength) override; \
104
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *bytes, uint32_t byteLength) override; \
105
  NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) override; \
106
  NS_IMETHOD Close(void) override; \
107
  NS_IMETHOD JoinMulticast(const nsACString& multicastAddress, const nsACString& iface) override; \
108
  NS_IMETHOD LeaveMulticast(const nsACString& multicastAddress, const nsACString& iface) override; 
109
110
/* Use this macro when declaring the members of this interface when the
111
   class doesn't implement the interface. This is useful for forwarding. */
112
#define NS_DECL_NON_VIRTUAL_NSIUDPSOCKETCHILD \
113
  nsresult GetLocalPort(uint16_t *aLocalPort); \
114
  nsresult GetLocalAddress(nsACString& aLocalAddress); \
115
  nsresult GetFilterName(nsACString& aFilterName); \
116
  nsresult SetFilterName(const nsACString& aFilterName); \
117
  nsresult SetBackgroundSpinsEvents(void); \
118
  nsresult Bind(nsIUDPSocketInternal *socket, nsIPrincipal *principal, const nsACString& host, uint16_t port, bool addressReuse, bool loopback, uint32_t recvBufferSize, uint32_t sendBufferSize, nsIEventTarget *mainThreadTarget); \
119
  nsresult Connect(nsIUDPSocketInternal *socket, const nsACString& host, uint16_t port); \
120
  nsresult Send(const nsACString& host, uint16_t port, const uint8_t *bytes, uint32_t byteLength); \
121
  nsresult SendWithAddr(nsINetAddr *addr, const uint8_t *bytes, uint32_t byteLength); \
122
  nsresult SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *bytes, uint32_t byteLength); \
123
  nsresult SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream); \
124
  nsresult Close(void); \
125
  nsresult JoinMulticast(const nsACString& multicastAddress, const nsACString& iface); \
126
  nsresult LeaveMulticast(const nsACString& multicastAddress, const nsACString& iface); 
127
128
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
129
#define NS_FORWARD_NSIUDPSOCKETCHILD(_to) \
130
  NS_IMETHOD GetLocalPort(uint16_t *aLocalPort) override { return _to GetLocalPort(aLocalPort); } \
131
  NS_IMETHOD GetLocalAddress(nsACString& aLocalAddress) override { return _to GetLocalAddress(aLocalAddress); } \
132
  NS_IMETHOD GetFilterName(nsACString& aFilterName) override { return _to GetFilterName(aFilterName); } \
133
  NS_IMETHOD SetFilterName(const nsACString& aFilterName) override { return _to SetFilterName(aFilterName); } \
134
  NS_IMETHOD SetBackgroundSpinsEvents(void) override { return _to SetBackgroundSpinsEvents(); } \
135
  NS_IMETHOD Bind(nsIUDPSocketInternal *socket, nsIPrincipal *principal, const nsACString& host, uint16_t port, bool addressReuse, bool loopback, uint32_t recvBufferSize, uint32_t sendBufferSize, nsIEventTarget *mainThreadTarget) override { return _to Bind(socket, principal, host, port, addressReuse, loopback, recvBufferSize, sendBufferSize, mainThreadTarget); } \
136
  NS_IMETHOD Connect(nsIUDPSocketInternal *socket, const nsACString& host, uint16_t port) override { return _to Connect(socket, host, port); } \
137
  NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *bytes, uint32_t byteLength) override { return _to Send(host, port, bytes, byteLength); } \
138
  NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *bytes, uint32_t byteLength) override { return _to SendWithAddr(addr, bytes, byteLength); } \
139
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *bytes, uint32_t byteLength) override { return _to SendWithAddress(addr, bytes, byteLength); } \
140
  NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) override { return _to SendBinaryStream(host, port, stream); } \
141
  NS_IMETHOD Close(void) override { return _to Close(); } \
142
  NS_IMETHOD JoinMulticast(const nsACString& multicastAddress, const nsACString& iface) override { return _to JoinMulticast(multicastAddress, iface); } \
143
  NS_IMETHOD LeaveMulticast(const nsACString& multicastAddress, const nsACString& iface) override { return _to LeaveMulticast(multicastAddress, iface); } 
144
145
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
146
#define NS_FORWARD_SAFE_NSIUDPSOCKETCHILD(_to) \
147
  NS_IMETHOD GetLocalPort(uint16_t *aLocalPort) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLocalPort(aLocalPort); } \
148
  NS_IMETHOD GetLocalAddress(nsACString& aLocalAddress) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLocalAddress(aLocalAddress); } \
149
  NS_IMETHOD GetFilterName(nsACString& aFilterName) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFilterName(aFilterName); } \
150
  NS_IMETHOD SetFilterName(const nsACString& aFilterName) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilterName(aFilterName); } \
151
  NS_IMETHOD SetBackgroundSpinsEvents(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBackgroundSpinsEvents(); } \
152
  NS_IMETHOD Bind(nsIUDPSocketInternal *socket, nsIPrincipal *principal, const nsACString& host, uint16_t port, bool addressReuse, bool loopback, uint32_t recvBufferSize, uint32_t sendBufferSize, nsIEventTarget *mainThreadTarget) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Bind(socket, principal, host, port, addressReuse, loopback, recvBufferSize, sendBufferSize, mainThreadTarget); } \
153
  NS_IMETHOD Connect(nsIUDPSocketInternal *socket, const nsACString& host, uint16_t port) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Connect(socket, host, port); } \
154
  NS_IMETHOD Send(const nsACString& host, uint16_t port, const uint8_t *bytes, uint32_t byteLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Send(host, port, bytes, byteLength); } \
155
  NS_IMETHOD SendWithAddr(nsINetAddr *addr, const uint8_t *bytes, uint32_t byteLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendWithAddr(addr, bytes, byteLength); } \
156
  NS_IMETHOD SendWithAddress(const mozilla::net::NetAddr * addr, const uint8_t *bytes, uint32_t byteLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendWithAddress(addr, bytes, byteLength); } \
157
  NS_IMETHOD SendBinaryStream(const nsACString& host, uint16_t port, nsIInputStream *stream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendBinaryStream(host, port, stream); } \
158
  NS_IMETHOD Close(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
159
  NS_IMETHOD JoinMulticast(const nsACString& multicastAddress, const nsACString& iface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->JoinMulticast(multicastAddress, iface); } \
160
  NS_IMETHOD LeaveMulticast(const nsACString& multicastAddress, const nsACString& iface) override { return !_to ? NS_ERROR_NULL_POINTER : _to->LeaveMulticast(multicastAddress, iface); } 
161
162
163
/* starting interface:    nsIUDPSocketInternal */
164
#define NS_IUDPSOCKETINTERNAL_IID_STR "613dd3ad-598b-4da9-ad63-bbda50c20098"
165
166
#define NS_IUDPSOCKETINTERNAL_IID \
167
  {0x613dd3ad, 0x598b, 0x4da9, \
168
    { 0xad, 0x63, 0xbb, 0xda, 0x50, 0xc2, 0x00, 0x98 }}
169
170
class NS_NO_VTABLE nsIUDPSocketInternal : public nsISupports {
171
 public:
172
173
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUDPSOCKETINTERNAL_IID)
174
175
  /* void callListenerOpened (); */
176
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD CallListenerOpened(void) = 0;
177
178
  /* void callListenerConnected (); */
179
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD CallListenerConnected(void) = 0;
180
181
  /* void callListenerClosed (); */
182
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD CallListenerClosed(void) = 0;
183
184
  /* void callListenerReceivedData (in AUTF8String host, in unsigned short port, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength); */
185
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD CallListenerReceivedData(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength) = 0;
186
187
  /* void callListenerError (in AUTF8String message, in AUTF8String filename, in uint32_t lineNumber); */
188
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD CallListenerError(const nsACString& message, const nsACString& filename, uint32_t lineNumber) = 0;
189
190
};
191
192
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIUDPSocketInternal, NS_IUDPSOCKETINTERNAL_IID)
193
194
/* Use this macro when declaring classes that implement this interface. */
195
#define NS_DECL_NSIUDPSOCKETINTERNAL \
196
  NS_IMETHOD CallListenerOpened(void) override; \
197
  NS_IMETHOD CallListenerConnected(void) override; \
198
  NS_IMETHOD CallListenerClosed(void) override; \
199
  NS_IMETHOD CallListenerReceivedData(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength) override; \
200
  NS_IMETHOD CallListenerError(const nsACString& message, const nsACString& filename, uint32_t lineNumber) override; 
201
202
/* Use this macro when declaring the members of this interface when the
203
   class doesn't implement the interface. This is useful for forwarding. */
204
#define NS_DECL_NON_VIRTUAL_NSIUDPSOCKETINTERNAL \
205
  nsresult CallListenerOpened(void); \
206
  nsresult CallListenerConnected(void); \
207
  nsresult CallListenerClosed(void); \
208
  nsresult CallListenerReceivedData(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength); \
209
  nsresult CallListenerError(const nsACString& message, const nsACString& filename, uint32_t lineNumber); 
210
211
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
212
#define NS_FORWARD_NSIUDPSOCKETINTERNAL(_to) \
213
  NS_IMETHOD CallListenerOpened(void) override { return _to CallListenerOpened(); } \
214
  NS_IMETHOD CallListenerConnected(void) override { return _to CallListenerConnected(); } \
215
  NS_IMETHOD CallListenerClosed(void) override { return _to CallListenerClosed(); } \
216
  NS_IMETHOD CallListenerReceivedData(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength) override { return _to CallListenerReceivedData(host, port, data, dataLength); } \
217
  NS_IMETHOD CallListenerError(const nsACString& message, const nsACString& filename, uint32_t lineNumber) override { return _to CallListenerError(message, filename, lineNumber); } 
218
219
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
220
#define NS_FORWARD_SAFE_NSIUDPSOCKETINTERNAL(_to) \
221
0
  NS_IMETHOD CallListenerOpened(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CallListenerOpened(); } \
222
0
  NS_IMETHOD CallListenerConnected(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CallListenerConnected(); } \
223
0
  NS_IMETHOD CallListenerClosed(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CallListenerClosed(); } \
224
0
  NS_IMETHOD CallListenerReceivedData(const nsACString& host, uint16_t port, const uint8_t *data, uint32_t dataLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CallListenerReceivedData(host, port, data, dataLength); } \
225
0
  NS_IMETHOD CallListenerError(const nsACString& message, const nsACString& filename, uint32_t lineNumber) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CallListenerError(message, filename, lineNumber); } 
226
227
228
#endif /* __gen_nsIUDPSocketChild_h__ */