GCC Code Coverage Report
Directory: ../src/ Exec Total Coverage
File: /home/node-core-coverage/node-core-coverage/workdir/node/out/../src/udp_wrap.h Lines: 1 2 50.0 %
Date: 2017-01-02 Branches: 0 0 0.0 %

Line Branch Exec Source
1
#ifndef SRC_UDP_WRAP_H_
2
#define SRC_UDP_WRAP_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include "async-wrap.h"
7
#include "env.h"
8
#include "handle_wrap.h"
9
#include "req-wrap.h"
10
#include "req-wrap-inl.h"
11
#include "uv.h"
12
#include "v8.h"
13
14
namespace node {
15
16
89
class UDPWrap: public HandleWrap {
17
 public:
18
  static void Initialize(v8::Local<v8::Object> target,
19
                         v8::Local<v8::Value> unused,
20
                         v8::Local<v8::Context> context);
21
  static void GetFD(v8::Local<v8::String>,
22
                    const v8::PropertyCallbackInfo<v8::Value>&);
23
  static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
24
  static void Bind(const v8::FunctionCallbackInfo<v8::Value>& args);
25
  static void Send(const v8::FunctionCallbackInfo<v8::Value>& args);
26
  static void Bind6(const v8::FunctionCallbackInfo<v8::Value>& args);
27
  static void Send6(const v8::FunctionCallbackInfo<v8::Value>& args);
28
  static void RecvStart(const v8::FunctionCallbackInfo<v8::Value>& args);
29
  static void RecvStop(const v8::FunctionCallbackInfo<v8::Value>& args);
30
  static void AddMembership(const v8::FunctionCallbackInfo<v8::Value>& args);
31
  static void DropMembership(const v8::FunctionCallbackInfo<v8::Value>& args);
32
  static void SetMulticastTTL(const v8::FunctionCallbackInfo<v8::Value>& args);
33
  static void SetMulticastLoopback(
34
      const v8::FunctionCallbackInfo<v8::Value>& args);
35
  static void SetBroadcast(const v8::FunctionCallbackInfo<v8::Value>& args);
36
  static void SetTTL(const v8::FunctionCallbackInfo<v8::Value>& args);
37
38
  static v8::Local<v8::Object> Instantiate(Environment* env, AsyncWrap* parent);
39
  uv_udp_t* UVHandle();
40
41
  size_t self_size() const override { return sizeof(*this); }
42
43
 private:
44
  typedef uv_udp_t HandleType;
45
46
  template <typename T,
47
            int (*F)(const typename T::HandleType*, sockaddr*, int*)>
48
  friend void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>&);
49
50
  UDPWrap(Environment* env, v8::Local<v8::Object> object, AsyncWrap* parent);
51
52
  static void DoBind(const v8::FunctionCallbackInfo<v8::Value>& args,
53
                     int family);
54
  static void DoSend(const v8::FunctionCallbackInfo<v8::Value>& args,
55
                     int family);
56
  static void SetMembership(const v8::FunctionCallbackInfo<v8::Value>& args,
57
                            uv_membership membership);
58
59
  static void OnAlloc(uv_handle_t* handle,
60
                      size_t suggested_size,
61
                      uv_buf_t* buf);
62
  static void OnSend(uv_udp_send_t* req, int status);
63
  static void OnRecv(uv_udp_t* handle,
64
                     ssize_t nread,
65
                     const uv_buf_t* buf,
66
                     const struct sockaddr* addr,
67
                     unsigned int flags);
68
69
  uv_udp_t handle_;
70
};
71
72
}  // namespace node
73
74
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
75
76
#endif  // SRC_UDP_WRAP_H_