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