Home | Trees | Index | Help |
---|
Package paramiko :: Class Message |
|
object
--+
|
Message
An SSH2 Message is a stream of bytes that encodes some combination of strings, integers, bools, and infinite-precision integers (known in python as longs). This class builds or breaks down such a byte stream.
Normally you don't need to deal with anything this low-level, but it's exposed for people implementing custom extensions, or features that paramiko doesn't support yet.Method Summary | |
---|---|
Create a new SSH2 Message. | |
string |
Returns a string representation of this object, for debugging. |
string |
Return the byte stream content of this Message, as a string. |
Add a sequence of items to the stream. | |
Add a boolean value to the stream. | |
Write a single byte to the stream, without any formatting. | |
Write bytes to the stream, without any formatting. | |
Add an integer to the stream. | |
Add a 64-bit int to the stream. | |
Add a list of strings to the stream. | |
Add a long int to the stream, encoded as an infinite-precision integer. | |
Add a string to the stream. | |
bool |
Fetch a boolean from the stream. |
string |
Return the next byte of the Message, without decomposing it. |
string |
Return the next n bytes of the Message, without
decomposing into an int, string, etc. |
int |
Fetch an int from the stream. |
long |
Fetch a 64-bit int from the stream. |
list of strings |
Fetch a list of strings from the stream. |
long |
Fetch a long int (mpint) from the stream. |
string |
Return the bytes of this Message that haven't already been parsed and returned. |
string |
Returns the bytes of this Message that have been parsed and returned. |
string |
Fetch a string from the stream. |
Rewind the message to the beginning as if no items had been parsed out of it yet. | |
_add(self,
i)
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value |
Method Details |
---|
__init__(self,
content=None)
Create a new SSH2 Message.
|
__repr__(self)
Returns a string representation of this object, for debugging.
|
__str__(self)
Return the byte stream content of this Message, as a string.
|
add(self, *seq)Add a sequence of items to the stream. The values are encoded based on their type: str, int, bool, list, or long.
|
add_boolean(self, b)Add a boolean value to the stream.
|
add_byte(self, b)Write a single byte to the stream, without any formatting.
|
add_bytes(self, b)Write bytes to the stream, without any formatting.
|
add_int(self, n)Add an integer to the stream.
|
add_int64(self, n)Add a 64-bit int to the stream.
|
add_list(self, l)Add a list of strings to the stream. They are encoded identically to a single string of values separated by commas. (Yes, really, that's how SSH2 does it.)
|
add_mpint(self, z)Add a long int to the stream, encoded as an infinite-precision integer. This method only works on positive numbers.
|
add_string(self, s)Add a string to the stream.
|
get_boolean(self)Fetch a boolean from the stream.
|
get_byte(self)Return the next byte of the Message, without decomposing it. This is equivalent toget_bytes(1) .
|
get_bytes(self, n)Return the nextn bytes of the Message, without
decomposing into an int, string, etc. Just the raw bytes are
returned.
|
get_int(self)Fetch an int from the stream.
|
get_int64(self)Fetch a 64-bit int from the stream.
|
get_list(self)Fetch a list of strings from the stream. These are trivially encoded as comma-separated values in a string.
|
get_mpint(self)Fetch a long int (mpint) from the stream.
|
get_remainder(self)Return the bytes of this Message that haven't already been parsed and returned.
|
get_so_far(self)Returns the bytes of this Message that have been parsed and returned. The string passed into a Message's constructor can be regenerated by concatenatingget_so_far and get_remainder .
|
get_string(self)Fetch a string from the stream. This could be a byte string and may contain unprintable characters. (It's not unheard of for a string to contain another byte-stream Message.)
|
rewind(self)Rewind the message to the beginning as if no items had been parsed out of it yet. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Dec 4 11:16:46 2005 | http://epydoc.sf.net |