File: icp.h

package info (click to toggle)
echoping 6.0.2-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 9,296 kB
  • ctags: 515
  • sloc: sh: 8,951; ansic: 3,352; makefile: 170
file content (62 lines) | stat: -rw-r--r-- 2,042 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef ICP_HEADER

#define ICP_HEADER

/* Version */
#define ICP_VERSION_1           1   
#define ICP_VERSION_2           2
#define ICP_VERSION_3           3
#define ICP_VERSION_CURRENT     ICP_VERSION_2

#define ICP_FLAG_HIT_OBJ	0x80000000ul
#define ICP_FLAG_SRC_RTT	0x40000000ul

#if SIZEOF_INT == 4
typedef unsigned int u_num32;
#elif SIZEOF_LONG == 4
typedef unsigned long u_num32;
#else
#error "No suitable type for representing a 32-bits value"
#endif

struct icp_common_s {
    unsigned char opcode;       /* opcode */
    unsigned char version;      /* version number */
    unsigned short length;      /* total length (bytes) */
    u_num32 reqnum;             /* req number (req'd for UDP) */
    u_num32 flags;
    u_num32 pad;
    u_num32 shostid;            /* sender host id */
};
typedef struct icp_common_s icp_common_t;

typedef enum {
    ICP_OP_INVALID,		/* 00 to insure 0 doesn't get accidently interpreted. */
    ICP_OP_QUERY,		/* 01 query opcode (cl->sv) */
    ICP_OP_HIT,			/* 02 hit (cl<-sv) */
    ICP_OP_MISS,		/* 03 miss (cl<-sv) */
    ICP_OP_ERR,			/* 04 error (cl<-sv) */
    ICP_OP_SEND,		/* 05 send object non-auth (cl->sv) */
    ICP_OP_SENDA,		/* 06 send object authoritative (cl->sv) */
    ICP_OP_DATABEG,		/* 07 first data, but not last (sv<-cl) */
    ICP_OP_DATA,		/* 08 data middle of stream (sv<-cl) */
    ICP_OP_DATAEND,		/* 09 last data (sv<-cl) */
    ICP_OP_SECHO,		/* 10 echo from source (sv<-os) */
    ICP_OP_DECHO,		/* 11 echo from dumb cache (sv<-dc) */
    ICP_OP_UNUSED0,		/* 12 */
    ICP_OP_UNUSED1,		/* 13 */
    ICP_OP_UNUSED2,		/* 14 */
    ICP_OP_UNUSED3,		/* 15 */
    ICP_OP_UNUSED4,		/* 16 */
    ICP_OP_UNUSED5,		/* 17 */
    ICP_OP_UNUSED6,		/* 18 */
    ICP_OP_UNUSED7,		/* 19 */
    ICP_OP_UNUSED8,		/* 20 */
    ICP_OP_MISS_NOFETCH,	/* 21 access denied while reloading */
    ICP_OP_DENIED,		/* 22 access denied (cl<-sv) */
    ICP_OP_HIT_OBJ,		/* 23 hit with object data (cl<-sv) */
    ICP_OP_END			/* 24 marks end of opcodes */
} icp_opcode;


#endif  /* ICP_HEADER */