1#ifndef ROSE_BinaryAnalysis_VxworksTerminal_H
2#define ROSE_BinaryAnalysis_VxworksTerminal_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/AddressInterval.h>
7#include <Rose/BinaryAnalysis/MemoryMap.h>
8#include <Rose/Diagnostics.h>
10#include <Sawyer/PartialResult.h>
11#include <Sawyer/Result.h>
16namespace BinaryAnalysis {
29 std::string
prompt =
"/[_a-zA-Z0-9]+->|-> /";
33 std::string
host =
"localhost";
37 void print(std::ostream&)
const;
160 const std::string &name);
165 bool matchPrompt(
const std::string&);
Handle data transfers to/from the VxWorks terminal.
@ TERMINATE
Terminate transfer at next opportunity.
@ NORMAL
Normal operational state transferring and handling data.
@ DRAIN
Terminate transfer when output to server becomes empty.
virtual std::string handleInput(const std::string &line)=0
Called for each line emitted by the VxWorks terminal.
virtual std::string handlePrompt(const std::string &prompt)=0
Called each time a prompt is detected from the VxWorks terminal.
State state
Current state of operation.
Information about connecting to a VxWorks terminal.
double timeoutSeconds
Number of seconds before assuming a missed prompt.
std::string host
Telnet server host or IP.
AddressInterval where
Affected addresses.
size_t bytesPerRequest
Number of bytes to request per terminal command.
unsigned permissions
Mapping permissions.
std::string prompt
VxWorks terminal prompt "literal" or "/regex/".
double delaySeconds
Number of seconds to delay before each command.
uint16_t port
TCP port at which the telnet server is listening.
Connection to a VxWorks terminal.
static std::string locatorStringDocumentation(const Settings &)
Generate locator string documentation.
const Settings & settings() const
Property: Configuration settings.
Sawyer::PartialResult< AddressInterval, std::string > download(const MemoryMapPtr &destination, const AddressInterval &, const std::string &name)
Download memory from an open connection into a map.
Settings & settings()
Property: Configuration settings.
static Ptr instance()
Allocating constructor.
static void initDiagnostics()
Initialize diagnostic streams.
Sawyer::PartialResult< AddressInterval, std::string > download(const MemoryMapPtr &destination, const std::string &name)
Download memory from an open connection into a map.
VxworksTerminalPtr Ptr
Shared-ownership pointer.
Sawyer::Optional< std::string > open()
Open a connection to the terminal.
Sawyer::PartialResult< std::vector< uint8_t >, std::string > download(const AddressInterval &)
Download memory from an open connection.
static Ptr instance(const Settings &)
Allocating constructor.
bool isOpen() const
Test whether the connection is open.
static Sawyer::Result< Settings, MemoryMap::LocatorError > parseLocatorString(const std::string &, const Settings &dflt)
Parse a VxWorks terminal locator string.
Sawyer::PartialResult< std::vector< uint8_t >, std::string > download()
Download memory from an open connection.
Holds a value or nothing.
Result containing a value and an error.
Result containing a value or an error.
std::shared_ptr< VxworksTerminal > VxworksTerminalPtr
Reference counting pointer.