Motr
M0
onwire.h
Go to the documentation of this file.
1
/* -*- C -*- */
2
/*
3
* Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
* For any questions about this software or licensing,
18
* please email opensource@seagate.com or cortx-questions@seagate.com.
19
*
20
*/
21
22
23
#pragma once
24
25
#ifndef __MOTR_RPC_ONWIRE_H__
26
#define __MOTR_RPC_ONWIRE_H__
27
28
#include "
lib/types.h
"
/* uint64_t */
29
#include "lib/types_xc.h"
/* m0_uint128_xc */
30
#include "
lib/cookie.h
"
31
#include "lib/cookie_xc.h"
32
#include "
xcode/xcode_attr.h
"
/* M0_XCA_RECORD */
33
#include "
format/format.h
"
/* struct m0_format_header */
34
#include "format/format_xc.h"
35
41
enum
{
42
M0_RPC_VERSION_1
= 1,
43
};
44
45
enum
{
46
/*
47
* Version of RPC packet
48
*/
49
50
M0_RPC_PACKET_FORMAT_VERSION_1
= 1,
51
52
/* future versions, uncomment and update M0_RPC_PACKET_FORMAT_VERSION */
53
/*M0_RPC_PACKET_FORMAT_VERSION_2,*/
54
/*M0_RPC_PACKET_FORMAT_VERSION_3,*/
55
60
M0_RPC_PACKET_FORMAT_VERSION
=
M0_RPC_PACKET_FORMAT_VERSION_1
,
61
62
/*
63
* Version of RPC item
64
*/
65
66
M0_RPC_ITEM_FORMAT_VERSION_1
= 1,
67
M0_RPC_ITEM_FORMAT_VERSION
=
M0_RPC_ITEM_FORMAT_VERSION_1
,
68
};
69
70
struct
m0_rpc_packet_onwire_header
{
71
struct
m0_format_header
poh_header
;
72
/* Version */
73
uint32_t
poh_version
;
75
uint32_t
poh_nr_items
;
76
uint64_t
poh_magic
;
77
} M0_XCA_RECORD
M0_XCA_DOMAIN
(rpc);
78
79
struct
m0_rpc_packet_onwire_footer
{
80
struct
m0_format_footer
pof_footer
;
81
} M0_XCA_RECORD
M0_XCA_DOMAIN
(rpc);
82
83
struct
m0_rpc_item_header1
{
84
struct
m0_format_header
ioh_header
;
86
uint32_t
ioh_opcode
;
88
uint32_t
ioh_flags
;
90
uint64_t
ioh_ha_epoch
;
91
uint64_t
ioh_magic
;
92
} M0_XCA_RECORD
M0_XCA_DOMAIN
(rpc);
93
94
struct
m0_rpc_item_header2
{
95
struct
m0_uint128
osr_uuid
;
96
uint64_t
osr_sender_id
;
97
uint64_t
osr_session_id
;
104
uint64_t
osr_session_xid_min
;
105
uint64_t
osr_xid
;
106
struct
m0_cookie
osr_cookie
;
107
} M0_XCA_RECORD
M0_XCA_DOMAIN
(rpc);
108
109
struct
m0_rpc_item_footer
{
110
struct
m0_format_footer
iof_footer
;
111
} M0_XCA_RECORD
M0_XCA_DOMAIN
(rpc);
112
113
M0_INTERNAL
int
m0_rpc_item_header1_encdec
(
struct
m0_rpc_item_header1
*ioh,
114
struct
m0_bufvec_cursor
*
cur
,
115
enum
m0_xcode_what
what);
116
M0_INTERNAL
int
m0_rpc_item_footer_encdec
(
struct
m0_rpc_item_footer
*iof,
117
struct
m0_bufvec_cursor
*
cur
,
118
enum
m0_xcode_what
what);
119
122
#endif
/* __MOTR_RPC_ONWIRE_H__ */
m0_rpc_item_header1::ioh_ha_epoch
uint64_t ioh_ha_epoch
Definition:
onwire.h:90
m0_rpc_packet_onwire_header
Definition:
onwire.h:70
M0_RPC_PACKET_FORMAT_VERSION_1
Definition:
onwire.h:50
types.h
cur
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
Definition:
addb2.c:791
M0_RPC_VERSION_1
Definition:
onwire.h:42
m0_rpc_item_footer::iof_footer
struct m0_format_footer iof_footer
Definition:
onwire.h:110
m0_rpc_item_header1
Definition:
onwire.h:83
m0_cookie
Definition:
cookie.h:57
m0_rpc_item_header1_encdec
M0_INTERNAL int m0_rpc_item_header1_encdec(struct m0_rpc_item_header1 *ioh, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
Definition:
onwire.c:42
m0_rpc_item_header2::osr_session_id
uint64_t osr_session_id
Definition:
onwire.h:97
M0_RPC_ITEM_FORMAT_VERSION
Definition:
onwire.h:67
m0_rpc_item_header1::ioh_header
struct m0_format_header ioh_header
Definition:
onwire.h:84
m0_rpc_packet_onwire_header::poh_version
uint32_t poh_version
Definition:
onwire.h:73
m0_xcode_what
m0_xcode_what
Definition:
xcode.h:647
xcode_attr.h
m0_format_footer
Definition:
format.h:57
m0_rpc_item_header2
Definition:
onwire.h:94
m0_rpc_item_header2::osr_xid
uint64_t osr_xid
Definition:
onwire.h:105
m0_rpc_item_header2::osr_sender_id
uint64_t osr_sender_id
Definition:
onwire.h:96
format.h
m0_rpc_item_footer
Definition:
onwire.h:109
M0_RPC_PACKET_FORMAT_VERSION
Definition:
onwire.h:60
m0_rpc_packet_onwire_header::poh_header
struct m0_format_header poh_header
Definition:
onwire.h:71
cookie.h
m0_rpc_packet_onwire_footer::pof_footer
struct m0_format_footer pof_footer
Definition:
onwire.h:80
m0_uint128
Definition:
types.h:35
M0_XCA_DOMAIN
enum @124 M0_XCA_DOMAIN
m0_bufvec_cursor
Definition:
vec.h:319
m0_rpc_item_header2::osr_uuid
struct m0_uint128 osr_uuid
Definition:
onwire.h:95
m0_rpc_item_header1::ioh_opcode
uint32_t ioh_opcode
Definition:
onwire.h:86
m0_rpc_packet_onwire_header::poh_nr_items
uint32_t poh_nr_items
Definition:
onwire.h:75
m0_rpc_item_header2::osr_session_xid_min
uint64_t osr_session_xid_min
Definition:
onwire.h:104
m0_rpc_item_footer_encdec
M0_INTERNAL int m0_rpc_item_footer_encdec(struct m0_rpc_item_footer *iof, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
Definition:
onwire.c:58
M0_RPC_ITEM_FORMAT_VERSION_1
Definition:
onwire.h:66
m0_rpc_item_header2::osr_cookie
struct m0_cookie osr_cookie
Definition:
onwire.h:106
m0_rpc_packet_onwire_header::poh_magic
uint64_t poh_magic
Definition:
onwire.h:76
m0_rpc_item_header1::ioh_magic
uint64_t ioh_magic
Definition:
onwire.h:91
m0_rpc_item_header1::ioh_flags
uint32_t ioh_flags
Definition:
onwire.h:88
m0_rpc_packet_onwire_footer
Definition:
onwire.h:79
m0_format_header
Definition:
format.h:38
rpc
onwire.h
Generated on Thu Apr 14 2022 14:02:53 for Motr by
1.8.14