68 lines
2.8 KiB
C
68 lines
2.8 KiB
C
/***************************************************************************
|
|
ftsd control interface ( File Replication & Cache & Move & Delete Control) Header ( FtsdProtocol.h )
|
|
-----------------------------------------
|
|
begin : 2010/03/09
|
|
copyright : (C) 2005 SolutionBox Inc.
|
|
author : Service 1 Team
|
|
email : svc1@solbox.com
|
|
version : 3.2.0.R0811
|
|
|
|
CopyRight(C) 2005 SolutionBox Inc. All Rights reserved.
|
|
Redistribution and use in source and binary forms, with or with out
|
|
modification, are not permitted in outside of SolutionBox Inc.
|
|
***************************************************************************/
|
|
|
|
#ifndef __FTSD_PROTOCOL_H__
|
|
#define __FTSD_PROTOCOL_H__
|
|
|
|
|
|
struct FileTransferPacketHeader {
|
|
|
|
char stx; // Packet 유효성 관리 코드
|
|
char type; // Request or Response 여부 ( 0x00: Request, 0x01: Response )
|
|
char command[4]; // Command Code ( 4 Byte) : 0th control-ftsd, 1th ftsd-ftsd 사용.
|
|
char result[4]; // Result Code ( 4 Byte )
|
|
unsigned int data_length; // Packet Data 부분의 길이값 ( Network Byte Order 사용)
|
|
char extend_code[2]; // 확장 및 Padding bits ( 2 Byte )
|
|
};
|
|
|
|
|
|
// Packet Header stx 코드
|
|
#define HEADER_STX_CODE 0x02
|
|
|
|
// Packet Header type 구분코드
|
|
#define HEADER_TYPE_REQUEST 0x00
|
|
#define HEADER_TYPE_RESPONSE 0x01
|
|
|
|
|
|
// Packet command 공통.
|
|
#define COMMON_ALIVE_CHECK 0x7F
|
|
|
|
// Packet command : control 프로세스 <-> ftsd 통신 ( Command 첫번째 Byte 만 사용 )
|
|
#define NOT_CONTROL_COMMAND 0x00 // Control 이 전송한 요청이 아닌 경우.
|
|
#define CONTROL_FILE_REPLICATION 0x01 // Content 복제 생성 요청
|
|
#define CONTROL_FILE_CACHE 0x02 // Content 에 대해 Cache 폴더로 복제 요청
|
|
|
|
#define CONTROL_FILE_CHECK 0x03 // Content 에 대한 존재 여부, Size 확인 및 Hash 추출 요청
|
|
#define CONTROL_FILE_UNLINK 0x04 // Content 에 대한 unlink 처리 요청
|
|
|
|
// NEW 2016-05-04 huibong 토토디스크 지원용 기능 추가 (#27460)
|
|
#define CONTROL_FILE_CHECK_TOTO 0x05 // 토토디스크 고객사 지원을 위한 MD5 Hash 추출 기능 (2016-05-03 추가)
|
|
|
|
|
|
// Packet Result : type이 Reponse 인 경우에만 세팅됨.( 첫번째 Byte 만 사용시 )
|
|
#define HEADER_RESULT_SUCCESS 0x00
|
|
#define HEADER_RESULT_ERROR 0x01
|
|
|
|
|
|
// 기타 정보
|
|
#define LENGTH_FIELD_SIZE 4 // 가변데이터 형식 사용시 Length 필드의 메모리 크기 (unsigned int)
|
|
|
|
|
|
// unlink 요청시 Mode 설정 정보
|
|
#define UNLINK_MODE_NORMAL 0 // 해당 Content 가 존재하고 size 값이 정확한 경우에만 삭제, 나머지는 오류
|
|
#define UNLINK_MODE_FORCE 1 // 해당 Content 가 존재하지 않거나.. Size 값이 틀려도 강제로 삭제 처리.. 오류로 처리되는 상황은 통신, 시스템 오류 발생시.
|
|
|
|
|
|
#endif /* __FTSD_PROTOCOL_H__ */
|