pysap.SAPHDB module

class pysap.SAPHDB.SAPHDB(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: scapy.packet.Packet

SAP HANA SQL Command Network Protocol packet

This packet is used for the HANA SQL Command Network Protocol.

The message header is comprised of 32 bytes.

aliastypes = [<class 'pysap.SAPHDB.SAPHDB'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDB).sessionid>, <Field (SAPHDB).packetcount>, <Field (SAPHDB).varpartlength>, <Field (SAPHDB).varpartsize>, <Field (SAPHDB).noofsegm>, <Field (SAPHDB).packetoptions>, <Field (SAPHDB).reserved1>, <Field (SAPHDB).compressionvarpartlength>, <Field (SAPHDB).reserved2>, <Field (SAPHDB).segments>]
class pysap.SAPHDB.SAPHDBAuthGSSMethod(username, krb5ticket=None, krb5ticket_callback=None, krb5oid=None, typeoid=None)[source]

Bases: pysap.SAPHDB.SAPHDBAuthMethod

SAP HDB Authentication using GSS.

KRB5OID_KERBEROS5 = '1.2.840.113554.1.2.2'
METHOD = 'GSS'
TYPEOID_GSS_KRB5_NT_PRINCIPAL_NAME = '1.2.840.113554.1.2.2.1'
TYPEOID_GSS_KRB5_NT_PRINCIPAL_NAME_pre_RFC_1964 = '1.2.840.113554.1.2.2.2'
authenticate(connection)[source]

Method to authenticate the client connection. It performs the round trip with the server as required by the method implemented, and returns the AUTHENTICATION Part.

Parameters:connection (SAPHDBConnection) – connection to the server
Returns:authentication part to use in Connect packet
Return type:SAPHDBPart
Raise:SAPHDBAuthenticationError
craft_authentication_request(value=None, connection=None)[source]

The authentication requests contains an empty username, the method, and a GSS token.

In most of the cases this GSS token is a SPNego structure, although the HANA implementation doesn’t use the standard ASN.1 encoding and instead leverage the same Authentication Field format.

craft_authentication_response_part(auth_response_part, value=None)[source]

In GSS, the final round trip with the server returns a GSS token that is mech specific.

In the case of Kerberos, the reply to the final roundtrip before the CONNECT contains an GSSAPI KRB5 AP-REP structure. At this stage we’re not parsing nor validating it.

The part to include in the CONNECT message is just a confirmation of the authentication handled. Note that this CONNECT packet has the username specified as in all other auth mechanisms.

process_connect_response(connect_reponse, connection=None)[source]

Process the final response from the authentication process when needed, according to the authentication method.

class pysap.SAPHDB.SAPHDBAuthJWTMethod(username, jwt)[source]

Bases: pysap.SAPHDB.SAPHDBAuthMethod

SAP HDB Authentication using JWT (JSON Web Token).

METHOD = 'JWT'
craft_authentication_request(value=None, connection=None)[source]

Craft the initial authentication request and returns the packet to send. If a connection is provided, it will include the Client Context part from it (e.g. application name).

Parameters:
  • value (string) – value to include in the authentication request
  • connection (SAPHDBConnection) – HDB connection to get client context values if required
Returns:

the initial authentication request

Return type:

SAPHDB

class pysap.SAPHDB.SAPHDBAuthMethod(username)[source]

Bases: object

SAP HDB Authentication Method

This is the base class to define the authentication methods to use on a connection.

METHOD = None
authenticate(connection)[source]

Method to authenticate the client connection. It performs the round trip with the server as required by the method implemented, and returns the AUTHENTICATION Part.

Parameters:connection (SAPHDBConnection) – connection to the server
Returns:authentication part to use in Connect packet
Return type:SAPHDBPart
Raise:SAPHDBAuthenticationError
craft_authentication_request(value=None, connection=None)[source]

Craft the initial authentication request and returns the packet to send. If a connection is provided, it will include the Client Context part from it (e.g. application name).

Parameters:
  • value (string) – value to include in the authentication request
  • connection (SAPHDBConnection) – HDB connection to get client context values if required
Returns:

the initial authentication request

Return type:

SAPHDB

craft_authentication_response_part(auth_response_part, value=None)[source]

Craft the AUTHENTICATION Part to use as response during the authentication process.

Parameters:
  • auth_response_part (SAPHDBPartAuthentication) – Part obtained from the initial authentication response
  • value (string) – value to include in the authentication response
Returns:

the authentication response part

Return type:

SAPHDBPart

process_connect_response(connect_reponse, connection=None)[source]

Process the final response from the authentication process when needed, according to the authentication method.

class pysap.SAPHDB.SAPHDBAuthSAMLMethod(username, saml_assertion)[source]

Bases: pysap.SAPHDB.SAPHDBAuthMethod

SAP HDB Authentication using Security Assertion Markup Language (SAML) 2.0 Bearer Assertions.

METHOD = 'SAML'
craft_authentication_request(value=None, connection=None)[source]

The initial authentication request should be performed as usual in other methods, with an empty username and the entire SAML Assertion or SAML Response as the value.

craft_authentication_response_part(auth_response_part, value=None)[source]

In SAML, the first round trip with the server returns the SAML username to use when authentication, so we must set it at this point.

class pysap.SAPHDB.SAPHDBAuthScramMethod(username, password)[source]

Bases: pysap.SAPHDB.SAPHDBAuthMethod

SAP HDB Authentication using a SCRAM-based algorithm

This base class is used to abstract the common implementation across different algorithms.

SCRAM_CLASS = None
craft_authentication_request(value=None, connection=None)[source]

Instantiates the SCRAM class and craft the authentication request.

craft_authentication_response_part(auth_response_part, value=None)[source]

Calculates the client proof and craft the authentication response part.

obtain_client_proof(scram, client_key, auth_response_part)[source]

Calculates the client proof with the salt and server key obtained from the authentication response part.

class pysap.SAPHDB.SAPHDBAuthScramPBKDF2SHA256Method(username, password)[source]

Bases: pysap.SAPHDB.SAPHDBAuthScramMethod

SAP HDB Authentication using SCRAM-PBKDF2-SHA256 algorithm.

METHOD = 'SCRAMPBKDF2SHA256'
SCRAM_CLASS

alias of pysap.utils.crypto.SCRAM_PBKDF2SHA256

obtain_client_proof(scram, client_key, auth_response_part)[source]

Calculates the client proof with the salt and server key obtained from the authentication response part.

class pysap.SAPHDB.SAPHDBAuthScramSHA256Method(username, password)[source]

Bases: pysap.SAPHDB.SAPHDBAuthScramMethod

SAP HDB Authentication using SCRAM-SHA256 algorithm.

METHOD = 'SCRAMSHA256'
SCRAM_CLASS

alias of pysap.utils.crypto.SCRAM_SHA256

class pysap.SAPHDB.SAPHDBAuthSessionCookieMethod(username, session_cookie)[source]

Bases: pysap.SAPHDB.SAPHDBAuthMethod

SAP HDB Authentication using a Session Cookie.

METHOD = 'SessionCookie'
craft_authentication_request(value=None, connection=None)[source]

Craft the initial authentication request and returns the packet to send. If a connection is provided, it will include the Client Context part from it (e.g. application name).

Parameters:
  • value (string) – value to include in the authentication request
  • connection (SAPHDBConnection) – HDB connection to get client context values if required
Returns:

the initial authentication request

Return type:

SAPHDB

exception pysap.SAPHDB.SAPHDBAuthenticationError[source]

Bases: exceptions.Exception

SAP HDB Authentication exception

class pysap.SAPHDB.SAPHDBConnection(host, port, auth_method=None, route=None, pid=None, hostname=None, client_version=None, client_type=None, app_name=None)[source]

Bases: object

SAP HDB Connection

This class represents a basic client connection to a HANA server using the SQL Command Network Protocol.

authenticate()[source]

Authenticates the connection against the server using the selected method.

Raises:SAPHDBAuthenticationError
client_id

Returns the Client Id to use when authenticating and connecting to the server. If the PID and the hostname are not specified, by default uses ‘0@<hostname>’.

Returns:Client ID string
Return type:string
close()[source]

Closes the connection with the server

Raise:SAPHDBConnectionError
close_socket()[source]

Closes the underlaying socket of the connection

connect()[source]

Creates a SAPNIStreamSocket connection to the host/port. If a route was specified, connect to the target HANA server through the SAP Router.

Raises:SAPHDBConnectionError
connect_authenticate()[source]

Connects to the server, performs initialization and authenticates the client.

craft_client_context_part()[source]

Crafts the client context part that is sent to the server. It contains the information about the client version, type and application name. If those values are not specified, by default uses pysap’s version.

Returns:Client Context Part
Return type:SAPHDBPart
initialize()[source]

Initializes the connection with the server.

is_connected()[source]

Returns if the underlying socket is connected.

Returns:If the underlying socket is connected.
Return type:bool
recv()[source]

Receives a packet from the server.

As the length of the entire packet is not known, it first tries to get the 32-bytes header and obtain the variable length from it.

Returns:the received packet
Return type:SAPHDB
send(message)[source]

Sends a packet to the server

sr(message)[source]

Sends a packet to the server and receives a response.

exception pysap.SAPHDB.SAPHDBConnectionError[source]

Bases: exceptions.Exception

SAP HDB Connection exception

class pysap.SAPHDB.SAPHDBInitializationReply(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: scapy.packet.Packet

SAP HANA SQL Command Network Protocol Initialization Reply packet

This packet is used for the HANA SQL Command Network Protocol during initialization.

aliastypes = [<class 'pysap.SAPHDB.SAPHDBInitializationReply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBInitializationReply).product_major>, <Field (SAPHDBInitializationReply).product_minor>, <Field (SAPHDBInitializationReply).protocol_major>, <Field (SAPHDBInitializationReply).protocol_minor>, <Field (SAPHDBInitializationReply).padding>]
class pysap.SAPHDB.SAPHDBInitializationRequest(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: scapy.packet.Packet

SAP HANA SQL Command Network Protocol Initialization Request packet

This packet is used for the HANA SQL Command Network Protocol during initialization.

aliastypes = [<class 'pysap.SAPHDB.SAPHDBInitializationRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBInitializationRequest).initialization>]
class pysap.SAPHDB.SAPHDBMultiLineOptionPartRow(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Multi-line Option Part

This packet represents a collection of Option Part Rows

aliastypes = [<class 'pysap.SAPHDB.SAPHDBMultiLineOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBMultiLineOptionPartRow,SAPHDBPartTopologyInformation).argcount>, <Field (SAPHDBMultiLineOptionPartRow,SAPHDBPartTopologyInformation).rows>]
partkind = None
class pysap.SAPHDB.SAPHDBOptionPartRow(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Option Part Row

This packet represents a row in an Option Part.

Each row is comprised of a key, type and value.

aliastypes = [<class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = None
part_kind = None
class pysap.SAPHDB.SAPHDBPart(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Part

This packet represents a part within a HDB packet.

The part header is comprised of 16 bytes.

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPart'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBPart).partkind>, <Field (SAPHDBPart).partattributes>, <Field (SAPHDBPart).argumentcount>, <Field (SAPHDBPart).bigargumentcount>, <Field (SAPHDBPart).bufferlength>, <Field (SAPHDBPart).buffersize>, <scapy.fields.PadField object>]
class pysap.SAPHDB.SAPHDBPartAuthentication(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Authentication Part

This packet represents an Authentication Part. The Authentication part consists of a count value and then a number of key/value pairs expressed with field values.

Authentication methods documented in the specification are:
  • “GSS” - Provides GSS/Kerberos authentication.
  • “PLAINPASSWORD” - Reserved. Do not use.
  • “SAML” - Provides SAML authentication.
  • “SCRAMMD5” - Reserved. Do not use.
  • “SCRAMSHA256” - Provides password-based authentication.
Non-documented methods are:
  • “JWT”
  • “SAPLogon”
  • “SCRAMPBKDF2SHA256”
  • “SessionCookie”
  • “X509Internal”
Known authentication key values are:
  • GSS Authentication:
    • USERNAME - User name
    • METHODNAME - Method name
    • CLIENTCHALLENGE - Client challenge
      • KRB5OID - KRB5 object ID
      • TYPEOID - Type object ID
      • CLIENTGSSNAME - Client GSS Name
    • SERVERTOKEN - Server-specific Kerberos tokens
    • CLIENTOKEN - Client-specific Kerberos tokens
  • LDAP Authentication:
    • USERNAME - User name
    • METHODNAME - Method name (“LDAP”)
    • CLIENTCHALLENGE - Client challenge
    • SERVERCHALLENGE - Server Challenge
      • CLIENTNONCE - Specifies the client nonce that was sent in the initial request.
      • SERVERNONCE - Specifies the server nonce.
      • SERVERPUBLICKEY - Specifies the server public key.
      • CAPABILITYRESULT - Specifies the capability, chosen by the server, from the client request.
    • CLIENTPROOF - Specifies the client proof.
      • ENCRYPTEDSESSKEY - Specifies the encrypted session key. This is specified as: RSAEncrypt(public key, SESSIONKEY + SERVERNONCE).
      • ENCRYPTEDPASSWORD - Specifies the encrypted password. This is specified as: AES256Encrypt(SESSIONKEY, PASSWORD + SERVERNONCE).
    • SERVERPROOF - Specifies the authentication result from the LDAP server. This is specified as either SUCCESS or FAIL.
  • SAML Authentication:
    • USERNAME - Specifies the user name (always empty user name).
    • METHODNAME - Specifies the method name.
    • SAMLASSERTION - Specifies the SAML assertion.
    • SAMLUSER - Specifies the user name associated with the SAML assertion.
    • FINALDATA - Specifies the final data (this is empty).
    • SESSIONCOOKIE - Specifies the session cookie used for the reconnect.
  • SCRAMSHA256 Authentication:
    • USERNAME - Specifies the user name.
    • METHODNAME - Specifies the method name.
    • CLIENTCHALLENGE - Specifies the client challenge. (64 bytes)
    • SERVERCHALLENGEDATA - Specifies the server challenge.
      • SALT - Specifies the password salt.
      • SERVERCHALLENGE - Specifies the server challenge.
    • CLIENTPROOF - Specifies the client proof. (35 bytes)
      • SCRAMMESSAGE - Specifies the SCRAM HMAC message, the actual Client Proof that is sent to the server. (32 bytes)
    • SERVERPROOF - Specifies the server proof.
  • Session Cookie Authentication:
    • USERNAME - Specifies the user name.
    • METHODNAME - Specifies the method name.
    • SESSIONCOOKIE - Specifies the session cookie, process ID, and hostname.
    • SERVERREPLY - Specifies the server reply (this is empty).
    • FINALDATA - Specifies the final data (this is empty).
aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartAuthentication'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBPartAuthentication).count>, <Field (SAPHDBPartAuthentication).auth_fields>]
part_kind = 33
class pysap.SAPHDB.SAPHDBPartAuthenticationField(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Authentication Part Field

This packet represents a field in the Authentication Part.

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartAuthenticationField'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBPartAuthenticationField).length>, <Field (SAPHDBPartAuthenticationField).value>]
class pysap.SAPHDB.SAPHDBPartClientContext(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Client Context Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartClientContext'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Client Version', 2: 'Client Type', 3: 'Application Name'}
part_kind = 29
class pysap.SAPHDB.SAPHDBPartClientId(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Client ID Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartClientId'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBPartClientId).clientid>]
part_kind = 35
class pysap.SAPHDB.SAPHDBPartCommand(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Command Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartCommand'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBPartCommand).command>]
part_kind = 3
class pysap.SAPHDB.SAPHDBPartCommandInfo(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Command Information Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartCommandInfo'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Line Number', 2: 'Source Module'}
part_kind = 27
class pysap.SAPHDB.SAPHDBPartCommitOptions(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Commit Options Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartCommitOptions'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Hold Cursors Over Commit'}
part_kind = 43
class pysap.SAPHDB.SAPHDBPartConnectOptions(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Connect Options Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartConnectOptions'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Connection ID', 2: 'Complete Array Execution', 3: 'Client Locale', 4: 'Supports Large Bulk Operations', 5: 'Distribution Enabled', 6: 'Primary Connection ID', 7: 'Primary Connection Host', 8: 'Primary Connection Port', 9: 'Complete Data Type Support', 10: 'Large Number of Parameters Support', 11: 'System ID', 12: 'Data Format Version', 13: 'ABAP VARCHAR Mode', 14: 'Select for Update Supported', 15: 'Client Distribution Mode', 16: 'Engine Data Format Version', 17: 'Distribution Protocol Version', 18: 'Split Batch Commands', 19: 'Use Transaction Flags Only', 20: 'Row and Column Optimized Format', 21: 'Ignore Unknown Parts', 22: 'Table Output Parameter', 23: 'Data Format Version 2', 24: 'ITAB Parameter', 25: 'Describe Table Output Parameter', 26: 'Columnar Result Set', 27: 'Scrollable Result Set', 28: 'Client Info NULL Value Supported', 29: 'Associated Connection ID', 30: 'Non-Transactional Prepare', 31: 'Fast Data Access Enabled', 32: 'OS User', 33: 'Row Slot Image Result', 34: 'Endianness', 35: 'Update Topology Anwhere', 36: 'Enable Array Type', 37: 'Implicit LOB Streaming', 38: 'Cached View Property', 39: 'X OpenXA Protocol Supported', 40: 'Master Commit Redirection Supported', 41: 'Active/Active Protocol Version', 42: 'Active/Active Connection Origin Site', 43: 'Query Timeout Supported', 44: 'Full Version String', 45: 'Database Name', 46: 'Build Platform', 47: 'Implicit XA Session Supported', 48: 'Client Side Column Encryption Version', 49: 'Compression Level And Flags', 50: 'Client Side Re-Execution Supported', 51: 'Client Reconnect Wait Timeout', 52: 'Original Anchor Connection ID', 53: 'Flag Set 1', 54: 'Topology Network Group', 55: 'IP Address', 56: 'LRR Ping Time'}
part_kind = 42
class pysap.SAPHDB.SAPHDBPartDBConnectInfo(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol DB Connect Information Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartDBConnectInfo'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Database Name', 2: 'Host', 3: 'Port', 4: 'Is Connected'}
part_kind = 67
class pysap.SAPHDB.SAPHDBPartError(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Error Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartError'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBPartError).error_code>, <Field (SAPHDBPartError).error_position>, <Field (SAPHDBPartError).error_text_length>, <Field (SAPHDBPartError).error_level>, <Field (SAPHDBPartError).sql_state>, <scapy.fields.PadField object>]
part_kind = 6
class pysap.SAPHDB.SAPHDBPartFetchOptions(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Fetch Options Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartFetchOptions'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Result Set Pos'}
part_kind = 44
class pysap.SAPHDB.SAPHDBPartLOBFlags(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol LOB Flags Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartLOBFlags'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {0: 'Implicit Streaming'}
part_kind = 68
class pysap.SAPHDB.SAPHDBPartSessionContext(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Session Context Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartSessionContext'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Primary Connection ID', 2: 'Primary Host Name', 3: 'Primary Host Port Number', 4: 'Master Connection ID', 5: 'Master Host Name', 6: 'Master Host Port Number'}
part_kind = 34
class pysap.SAPHDB.SAPHDBPartStatementContext(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Statement Context Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartStatementContext'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {1: 'Statement Sequence Info', 2: 'Server Processing Time', 3: 'Schema Name', 4: 'Flag Set', 5: 'Query Time Out', 6: 'Client Reconnection Wait Timeout', 7: 'Server CPU Time', 8: 'Server Memory Usage'}
part_kind = 39
class pysap.SAPHDB.SAPHDBPartTopologyInformation(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBMultiLineOptionPartRow

SAP HANA SQL Command Network Protocol Topology Information Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartTopologyInformation'>, <class 'pysap.SAPHDB.SAPHDBMultiLineOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBMultiLineOptionPartRow,SAPHDBPartTopologyInformation).argcount>, <Field (SAPHDBMultiLineOptionPartRow,SAPHDBPartTopologyInformation).rows>]
option_keys = {1: 'Host Name', 2: 'Host Port Number', 3: 'Tenant Name', 4: 'Load Factor', 5: 'Site Volume ID', 6: 'Is Master', 7: 'Is Current Session', 8: 'Service Type', 9: 'Network Domain', 10: 'Is Stand-By', 11: 'All IP Addresses', 12: 'All Host Names', 13: 'Site Type'}
part_kind = 15
class pysap.SAPHDB.SAPHDBPartTransactionFlags(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.SAPHDB.SAPHDBOptionPartRow

SAP HANA SQL Command Network Protocol Transaction Flags Part

aliastypes = [<class 'pysap.SAPHDB.SAPHDBPartTransactionFlags'>, <class 'pysap.SAPHDB.SAPHDBOptionPartRow'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).key>, <Field (SAPHDBOptionPartRow,SAPHDBPartCommandInfo,SAPHDBPartClientContext,SAPHDBPartSessionContext,SAPHDBPartStatementContext,SAPHDBPartConnectOptions,SAPHDBPartCommitOptions,SAPHDBPartFetchOptions,SAPHDBPartTransactionFlags,SAPHDBPartDBConnectInfo,SAPHDBPartLOBFlags).type>, <scapy.fields.ConditionalField object>, <scapy.fields.MultipleTypeField object>]
option_keys = {0: 'Rolled Back', 1: 'Commited', 2: 'New Isolation Level', 3: 'DDL Commit Mode Changed', 4: 'Write Transaction Started', 5: 'No Write Transaction Started', 6: 'Session Closing Transaction Error'}
part_kind = 64
class pysap.SAPHDB.SAPHDBSegment(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)[source]

Bases: pysap.utils.fields.PacketNoPadded

SAP HANA SQL Command Network Protocol Segment

This packet represents a segment within a HDB packet.

The segment header is comprised of 24 byte, being the first 13 bytes always the same fields and the remaining 11 bytes depend on the segment kind field.

aliastypes = [<class 'pysap.SAPHDB.SAPHDBSegment'>, <class 'pysap.utils.fields.PacketNoPadded'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (SAPHDBSegment).segmentlength>, <Field (SAPHDBSegment).segmentofs>, <Field (SAPHDBSegment).noofparts>, <Field (SAPHDBSegment).segmentno>, <Field (SAPHDBSegment).segmentkind>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <Field (SAPHDBSegment).parts>]
class pysap.SAPHDB.SAPHDBTLSConnection(host, port, auth_method=None, route=None, pid=None, hostname=None, client_version=None, client_type=None, app_name=None, tls_cert_trust=None, tls_cert_file=None, tls_check_hostname=None, tls_protocol=None, tls_options=None, tls_ciphers=None)[source]

Bases: pysap.SAPHDB.SAPHDBConnection

SAP HDB Connection using TLS

This class wraps the connection socket with a TLS-enabled one for use as a secure channel. We’re using TLS 1.2 by default but setting RSA-based cipher suites without (EC)DHE so traffic can be easily decrypted in Wireshark.

TLS_CERT_FILE = None
TLS_CERT_TRUST = False
TLS_CHECK_HOSTNAME = False
TLS_DEFAULT_CIPHERS = 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:AES256-GCM-SHA384:AES256-CCM8'
TLS_DEFAULT_OPTIONS = 335544320
TLS_DEFAULT_PROTOCOL = 2
connect()[source]

Creates a SAPNIStreamSocket connection to the host/port. If a route was specified, connect to the target HANA server through the SAP Router.

Raises:SAPHDBConnectionError
pysap.SAPHDB.hdb_data_type_vals = {0: 'NULL', 1: 'TINYINT', 2: 'SMALLINT', 3: 'INT', 4: 'BIGINT', 5: 'DECIMAL', 6: 'REAL', 7: 'DOUBLE', 8: 'CHAR', 9: 'VARCHAR1', 10: 'NCHAR', 11: 'NVARCHAR', 12: 'BINARY', 13: 'VARBINARY', 14: 'DATE', 15: 'TIME', 16: 'TIMESTAMP', 17: 'TIME_TZ', 18: 'TIME_LTZ', 19: 'TIMESTAMP_TZ', 20: 'TIMESTAMP_LTZ', 21: 'INTERVAL_YM', 22: 'INTERVAL_DS', 23: 'ROWID', 24: 'UROWID', 25: 'CLOB', 26: 'NCLOB', 27: 'BLOB', 28: 'BOOLEAN', 29: 'STRING', 30: 'NSTRING', 31: 'LOCATOR', 32: 'NLOCATOR', 33: 'BSTRING', 34: 'DECIMAL_DIGIT_ARRAY', 35: 'VARCHAR2', 36: 'VARCHAR3', 37: 'NVARCHAR3', 38: 'VARBINARY3', 39: 'VARGROUP', 40: 'TINYINT_NOTNULL', 41: 'SMALLINT_NOTNULL', 42: 'INT_NOTNULL', 43: 'BIGINT_NOTNULL', 44: 'ARGUMENT', 45: 'TABLE', 46: 'CURSOR', 47: 'SMALLDECIMAL', 48: 'ABAPSTREAM', 49: 'ABAPSTRUCT', 50: 'ARRAY', 51: 'TEXT', 52: 'SHORTTEXT', 53: 'FIXEDSTRING', 54: 'FIXEDPOINTDECIMAL', 55: 'ALPHANUM', 56: 'TLOCATOR', 61: 'LONGDATE', 62: 'SECONDDATE', 63: 'DAYDATE', 64: 'SECONDTIME', 65: 'CSDATE', 66: 'CSTIME', 71: 'BLOB_DISK', 72: 'CLOB_DISK', 73: 'NCLOB_DISK', 74: 'GEOMETRY', 75: 'POINT', 76: 'FIXED16', 77: 'BLOB_HYBRID', 78: 'CLOB_HYBRID', 79: 'NCLOB_HYBRID', 80: 'POINTZ'}

SAP HDB Data Type Values

pysap.SAPHDB.hdb_error_level_vals = {0: 'WARNING', 1: 'ERROR', 2: 'FATALERROR'}

SAP HDB Error Level Values

pysap.SAPHDB.hdb_function_code_values = {0: 'NIL', 1: 'DDL', 2: 'INSERT', 3: 'UPDATE', 4: 'DELETE', 5: 'SELECT', 6: 'SELECTFORUPDATE', 7: 'EXPLAIN', 8: 'DBPROCEDURECALL', 9: 'DBPROCEDURECALLWITHRESULT', 10: 'FETCH', 11: 'COMMIT', 12: 'ROLLBACK', 13: 'SAVEPOINT', 14: 'CONNECT', 15: 'WRITELOB', 16: 'READLOB', 17: 'PING', 18: 'DISCONNECT', 19: 'CLOSECURSOR', 20: 'FINDLOB', 21: 'ABAPSTREAM', 22: 'XASTART', 23: 'XAJOIN', 24: 'ITABWRITE', 25: 'XOPEN_XACONTROL', 26: 'XOPEN_XAPREPARE', 27: 'XOPEN_XARECOVER'}

SAP HDB Segment Function Code Values

pysap.SAPHDB.hdb_get_part_kind_option(part, key)[source]

Helper function to obtain the value of an Option Part kind

Parameters:
Returns:

value from the Option Part kind

pysap.SAPHDB.hdb_message_type_values = {0: 'NIL', 2: 'EXECUTEDIRECT', 3: 'PREPARE', 4: 'ABAPSTREAM', 5: 'XA_START', 6: 'XA_JOIN', 7: 'XA_COMMIT', 13: 'EXECUTE', 16: 'READLOB', 17: 'WRITELOB', 18: 'FINDLOB', 25: 'PING', 65: 'AUTHENTICATE', 66: 'CONNECT', 67: 'COMMIT', 68: 'ROLLBACK', 69: 'CLOSERESULTSET', 70: 'DROPSTATEMENTID', 71: 'FETCHNEXT', 72: 'FETCHABSOLUTE', 73: 'FETCHRELATIVE', 74: 'FETCHFIRST', 75: 'FETCHLAST', 77: 'DISCONNECT', 78: 'EXECUTEITAB', 79: 'FETCHNEXTITAB', 80: 'INSERTNEXTITAB', 81: 'BATCHPREPARE', 82: 'DBCONNECTINFO', 83: 'XOPEN_XASTART', 84: 'XOPEN_XAEND', 85: 'XOPEN_XAPREPARE', 86: 'XOPEN_XACOMMIT', 87: 'XOPEN_XAROLLBACK', 88: 'XOPEN_XARECOVER', 89: 'XOPEN_XAFORGET'}

SAP HDB Segment Message Type Values

pysap.SAPHDB.hdb_packetoptions_values = {0: 'Uncompressed', 2: 'Compressed'}

SAP HDB Packet Options Values

pysap.SAPHDB.hdb_partkind_values = {0: 'NIL', 3: 'COMMAND', 5: 'RESULTSET', 6: 'ERROR', 10: 'STATEMENTID', 11: 'TRANSACTIONID', 12: 'ROWSAFFECTED', 13: 'RESULTSETID', 15: 'TOPOLOGYINFORMATION', 16: 'TABLELOCATION', 17: 'READLOBREQUEST', 18: 'READLOBREPLY', 25: 'ABAPISTREAM', 26: 'ABAPOSTREAM', 27: 'COMMANDINFO', 28: 'WRITELOBREQUEST', 29: 'CLIENTCONTEXT', 30: 'WRITELOBREPLY', 32: 'PARAMETERS', 33: 'AUTHENTICATION', 34: 'SESSIONCONTEXT', 35: 'CLIENTID', 38: 'PROFILE', 39: 'STATEMENTCONTEXT', 40: 'PARTITIONINFORMATION', 41: 'OUTPUTPARAMETERS', 42: 'CONNECTOPTIONS', 43: 'COMMITOPTIONS', 44: 'FETCHOPTIONS', 45: 'FETCHSIZE', 47: 'PARAMETERMETADATA', 48: 'RESULTSETMETADATA', 49: 'FINDLOBREQUEST', 50: 'FINDLOBREPLY', 51: 'ITABSHM', 53: 'ITABCHUNKMETADATA', 55: 'ITABMETADATA', 56: 'ITABRESULTCHUNK', 57: 'CLIENTINFO', 58: 'STREAMDATA', 59: 'OSTREAMRESULT', 60: 'FDAREQUESTMETADATA', 61: 'FDAREPLYMETADATA', 62: 'BATCHPREPARE', 63: 'BATCHEXECUTE', 64: 'TRANSACTIONFLAGS', 65: 'ROWSLOTIMAGEPARAMMETADATA', 66: 'ROWSLOTIMAGERESULTSET', 67: 'DBCONNECTINFO', 68: 'LOBFLAGS', 69: 'RESULTSETOPTIONS', 70: 'XATRANSACTIONINFO', 71: 'SESSIONVARIABLE', 72: 'WORKLOADREPLAYCONTEXT', 73: 'SQLREPLYOTIONS'}

SAP HDB Part Kind Values

pysap.SAPHDB.hdb_register_part_kind(cls)[source]

Helper function to use as a decorator when defining Part classes. It will register the class with the proper Part Kind so dissection can find it. It will also register the keys for the options defined in each Part Kind.

Parameters:cls (type) – Part class to register
Returns:Registered Part class
Return type:type
pysap.SAPHDB.hdb_segment_is_reply(segment)[source]

Returns if the segment is a reply

Parameters:segment (SAPHDBSegment) – segment to look at
Returns:if the segment is a reply
Return type:bool
pysap.SAPHDB.hdb_segment_is_request(segment)[source]

Returns if the segment is a request

Parameters:segment (SAPHDBSegment) – segment to look at
Returns:if the segment is a request
Return type:bool
pysap.SAPHDB.hdb_segmentkind_values = {0: 'Invalid', 1: 'Request', 2: 'Reply', 5: 'Error'}

SAP HDB Segment Kind Values

pysap.SAPHDB.saphdb_auth_methods = {'GSS': <class 'pysap.SAPHDB.SAPHDBAuthGSSMethod'>, 'JWT': <class 'pysap.SAPHDB.SAPHDBAuthJWTMethod'>, 'SAML': <class 'pysap.SAPHDB.SAPHDBAuthSAMLMethod'>, 'SCRAMPBKDF2SHA256': <class 'pysap.SAPHDB.SAPHDBAuthScramPBKDF2SHA256Method'>, 'SCRAMSHA256': <class 'pysap.SAPHDB.SAPHDBAuthScramSHA256Method'>, 'SessionCookie': <class 'pysap.SAPHDB.SAPHDBAuthSessionCookieMethod'>}

SAP HDB Authentication Methods Implemented

pysap.SAPHDB.saphdb_determine_part_class(pkt, lst, cur, remain)[source]

Determines the class of the buffer elements based on the Part Kind value.