|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace kalanis\RemoteRequest\Protocols; |
|
4
|
|
|
|
|
5
|
|
|
|
|
6
|
|
|
use kalanis\RemoteRequest; |
|
7
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Class Fsp |
|
11
|
|
|
* @package kalanis\RemoteRequest\Protocols |
|
12
|
|
|
* Properties for query to remote server - method FSP |
|
13
|
|
|
* @link http://fsp.sourceforge.net |
|
14
|
|
|
* @link https://sourceforge.net/p/fsp/code/ci/master/tree/doc/PROTOCOL |
|
15
|
|
|
*/ |
|
16
|
|
|
class Fsp extends Udp |
|
17
|
|
|
{ |
|
18
|
|
|
# how large is whole load |
|
19
|
|
|
public const HEADER_SIZE = 12; |
|
20
|
|
|
public const SPACE_SIZE = 1024; |
|
21
|
|
|
public const MAX_PACKET_SIZE = 1036; // 1024 + 12 |
|
22
|
|
|
|
|
23
|
|
|
# Command Codes |
|
24
|
|
|
public const CC_VERSION = 0x10; |
|
25
|
|
|
public const CC_ERR = 0x40; |
|
26
|
|
|
public const CC_GET_DIR = 0x41; |
|
27
|
|
|
public const CC_GET_FILE = 0x42; |
|
28
|
|
|
public const CC_UP_LOAD = 0x43; |
|
29
|
|
|
public const CC_INSTALL = 0x44; |
|
30
|
|
|
public const CC_DEL_FILE = 0x45; |
|
31
|
|
|
public const CC_DEL_DIR = 0x46; |
|
32
|
|
|
public const CC_GET_PRO = 0x47; |
|
33
|
|
|
public const CC_SET_PRO = 0x48; |
|
34
|
|
|
public const CC_MAKE_DIR = 0x49; |
|
35
|
|
|
public const CC_BYE = 0x4A; |
|
36
|
|
|
public const CC_GRAB_FILE = 0x4B; |
|
37
|
|
|
public const CC_GRAB_DONE = 0x4C; |
|
38
|
|
|
public const CC_STAT = 0x4D; |
|
39
|
|
|
public const CC_RENAME = 0x4E; |
|
40
|
|
|
public const CC_CH_PASSW = 0x4F; |
|
41
|
|
|
public const CC_LIMIT = 0x80; |
|
42
|
|
|
public const CC_TEST = 0x81; |
|
43
|
|
|
|
|
44
|
|
|
# RDIRENT Type Codes - directory blocks |
|
45
|
|
|
public const RDTYPE_END = 0x00; |
|
46
|
|
|
public const RDTYPE_FILE = 0x01; |
|
47
|
|
|
public const RDTYPE_DIR = 0x02; |
|
48
|
|
|
public const RDTYPE_LINK = 0x03; |
|
49
|
|
|
public const RDTYPE_SKIP = 0x2a; |
|
50
|
|
|
|
|
51
|
2 |
|
protected function loadQuery(): RemoteRequest\Protocols\Dummy\Query |
|
52
|
|
|
{ |
|
53
|
2 |
|
return new Fsp\Query(); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
2 |
|
protected function loadAnswer(): RemoteRequest\Protocols\Dummy\Answer |
|
57
|
|
|
{ |
|
58
|
2 |
|
return new Fsp\Answer($this->rrLang); |
|
59
|
|
|
} |
|
60
|
|
|
} |
|
61
|
|
|
|