GW2RegisterAnalysisMemory
GW2RegisterAnalysisMemory は、分析レポートを保存するメモリ位置をセッションに登録します。この関数を使用すると、そのSessionの Analysis Process が有効になります。
- C++
- C#
- Java
- Python
- JavaScript
概要
GW2RegisterAnalysisMemory 関数は、analysisFileBuffer が指すオブジェクトに、セッション session を使用して API 関数 runSession が正常に実行された際に生成された分析レポートへのポインタを格納します。分析レポートのサイズ(バイト単位)は、analysisLength が指すオブジェクトに格納されます。分析レポートの形式は、format で要求された形式になります。この関数を使用すると、そのセッションの Analysis Process Mode が有効になります。
#include "glasswall.core2.api.h"
int GW2RegisterAnalysisMemory(Session session,
char **analysisFileBuffer,
size_t analysisLength,
Analysis_format format);
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
例
#include "glasswall.core2.api.h"
Session_Handle session;
char *analysisReport = NULL;
size_t analysisReportSize = 0;
session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
if (GW2RegisterAnalysisMemory(session, &analysisReport, &analysisReportSize, PF_XML) < 0)
/* deal with error */
else
/* analysisReport points to the analysis report data */
}
/* later */
if (GW2CloseSession(session) < 0)
/* error closing session */
概要
public int RegisterAnalysisMemory(
int session,
out IntPtr analysisBufferPtr,
ref UIntPtr analysisBufferLengthPtr,
int Format)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
概要
import com.glasswall.core2javabridge.*;
public int GW2RegisterAnalysisMemory(int session, int format) throws GlasswallException
説明
GW2RegisterAnalysisMemory 関数は、session で指定されたセッションについて、分析レポートの出力先としてメモリバッファを登録します。分析レポートを取得するには、GW2RunSession を呼び出した後に GetAnalysisBuffer または GetAnalysisReport を呼び出してください。
format の有効な列挙子については、API Overview/Return types を参照してください。
戻り値
GW2RegisterAnalysisMemory 関数は、GW2_RetStatus 列挙を int に変換して返します。エラーが発生した場合、値は負になります。0 は成功を示します。詳細については、API Overview/Return types を参照してください。
GlasswallException 例外は、session が無効な場合にスローされます。
概要 - データの取得
import com.glasswall.core2javabridge.*;
public byte[] GetAnalysisBuffer(int session) throws GlasswallException
public String GetAnalysisReport(int session) throws GlasswallException
説明
GetAnalysisBuffer 関数は、session で指定されたセッションに関連付けられた分析レポートバッファの内容を取得します。
戻り値
GetAnalysisBuffer 関数は、分析レポートを含む Byte[] を返します。GetAnalysisReport 関数は、分析レポートを含む String を返します。GW2RunSession と GW2RegisterAnalysisMemory の両方が呼び出されていない場合、これらは null になります。
GlasswallException 例外は、session が無効な場合にスローされます。
概要
指定されたセッションに対して分析ファイルを登録します。分析ファイルは、そのセッションの run_session 呼び出し中に作成されます。
def register_analysis(self, session: int, output_file: Optional[str] = None):
""" Registers an analysis file for the given session. The analysis file will be created during the session's run_session call.
Args:
session (int): The session integer.
output_file (Optional[str]): Default None. The file path where the analysis will be written. None returns the analysis as bytes.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'status', 'session', 'analysis_format'. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size. If output_file is not None (file mode) 'output_file' is included.
"""
戻り値
gw_return_object (glasswall.GwReturnObj): 属性 'status'、'session'、'analysis_format' を持つ GwReturnObj インスタンスです。output_file が None の場合(メモリモード)、ファイル内容とファイルサイズを含む 'buffer' および 'buffer_length' が含まれます。output_file が None でない場合(ファイルモード)、'output_file' が含まれます。
status 属性は整数の GW2_RetStatus enum 値です。負の数は失敗を示します。
概要
この関数は、runSession の正常な実行によって生成された分析レポートへのポインタを保存します。
/**
*
* @param {number} session The ID of the session.
* @param {string} analysisFileBuffer The pointer to the location of the analysis report.
* @param {number} analysisOutputLength The size of the analysis report.
* @param {number} format The specified format.
*/
GW2RegisterAnalysisMemory(
session,
analysisFileBuffer,
analysisOutputLength,
format)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。