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 enum 값을 반환합니다. 음수는 실패를 나타냅니다.
예제
#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 enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
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이 유효하지 않으면 발생합니다.
개요
지정된 session에 대해 analysis file을 등록합니다. analysis file은 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 enum 값을 반환합니다. 음수는 실패를 나타냅니다.