A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tap-encode-decode.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 */
6
7#ifndef TAP_ENCODE_DECODE_H
8#define TAP_ENCODE_DECODE_H
9
10#include <cstdint>
11#include <string>
12
13namespace ns3
14{
15
16std::string TapBufferToString(uint8_t* buffer, uint32_t len);
17bool TapStringToBuffer(std::string s, uint8_t* buffer, uint32_t* len);
18
19} // namespace ns3
20
21#endif /* TAP_ENCODE_DECODE_H */
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool TapStringToBuffer(std::string s, uint8_t *buffer, uint32_t *len)
Convert string encoded by the inverse function (TapBufferToString) back into a byte buffer.
std::string TapBufferToString(uint8_t *buffer, uint32_t len)
Convert a byte buffer to a string containing a hex representation of the buffer.