Home | Trees | Indices | Help |
---|
|
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.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
int |
|
||
|
|||
|
|||
|
|||
string |
|
||
string |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Class Variables | |
big_int = 4278190080
|
Properties | |
Inherited from |
Method Details |
Create a new SSH2 message. :param str content: the byte stream to use as the message content (passed in only when decomposing a message).
|
Return the byte stream content of this message, as a string/bytes obj.
|
Returns a string representation of this object, for debugging.
|
Returns the `str` bytes of this message that have been parsed and returned. The string passed into a message's constructor can be regenerated by concatenating ``get_so_far`` and `get_remainder`. |
Return the next ``n`` bytes of the message (as a `str`), without decomposing into an int, decoded string, etc. Just the raw bytes are returned. Returns a string of ``n`` zero bytes if there weren't ``n`` bytes remaining in the message. |
Return the next byte of the message, without decomposing it. This is equivalent to `get_bytes(1) <get_bytes>`. :return: the next (`str`) byte of the message, or ``' '`` if there aren't any bytes remaining. |
Fetch an int from the stream. :return: a 32-bit unsigned `int`. |
Fetch an int from the stream.
|
Fetch a 64-bit int from the stream. :return: a 64-bit unsigned integer (`long`). |
Fetch a long int (mpint) from the stream. :return: an arbitrary-length integer (`long`). |
Fetch a `str` 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.) |
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.)
|
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.)
|
Fetch a `list` of `strings <str>` from the stream. These are trivially encoded as comma-separated values in a string. |
Write bytes to the stream, without any formatting. :param str b: bytes to add |
Write a single byte to the stream, without any formatting. :param str b: byte to add |
Add a boolean value to the stream. :param bool b: boolean value to add |
Add an integer to the stream. :param int n: integer to add |
Add an integer to the stream. :param int n: integer to add |
Add a 64-bit int to the stream. :param long n: long int to add |
Add a long int to the stream, encoded as an infinite-precision integer. This method only works on positive numbers. :param long z: long int to add |
Add a string to the stream. :param str s: string to add |
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.) :param list l: list of strings to add |
Add a sequence of items to the stream. The values are encoded based on their type: str, int, bool, list, or long. .. warning: Longs are encoded non-deterministically. Don't use this method. :param seq: the sequence of items |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Aug 29 06:01:16 2014 | http://epydoc.sourceforge.net |