Coverage Report

Created: 2024-05-20 06:23

/src/nss/fuzz/tls_socket.h
Line
Count
Source
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#ifndef tls_socket_h__
6
#define tls_socket_h__
7
8
#include "dummy_io.h"
9
10
class DummyPrSocket : public DummyIOLayerMethods {
11
 public:
12
69.0k
  DummyPrSocket(const uint8_t *buf, size_t len) : buf_(buf), len_(len) {}
13
69.0k
  virtual ~DummyPrSocket() {}
14
15
  int32_t Read(PRFileDesc *f, void *data, int32_t len) override;
16
  int32_t Write(PRFileDesc *f, const void *buf, int32_t length) override;
17
  int32_t Recv(PRFileDesc *f, void *buf, int32_t buflen, int32_t flags,
18
               PRIntervalTime to) override;
19
20
 private:
21
  const uint8_t *buf_;
22
  size_t len_;
23
};
24
25
#endif  // tls_socket_h__