1 /*
2  * librdkafka - The Apache Kafka C/C++ library
3  *
4  * Copyright (c) 2020 Magnus Edenhill
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  *    this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright notice,
13  *    this list of conditions and the following disclaimer in the documentation
14  *    and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _RDKAFKA_PROTOCOL_H_
30 #define _RDKAFKA_PROTOCOL_H_
31 
32 /**
33  * Kafka protocol defines.
34  *
35  * The separation from rdkafka_proto.h is to provide the protocol defines
36  * to C and C++ test code in tests/.
37  */
38 
39 #define RD_KAFKA_PORT      9092
40 #define RD_KAFKA_PORT_STR "9092"
41 
42 
43 /**
44  * Request types
45  *
46  * Generate updates to this list with generate_proto.sh.
47  */
48 #define RD_KAFKAP_None         -1
49 #define RD_KAFKAP_Produce       0
50 #define RD_KAFKAP_Fetch         1
51 #define RD_KAFKAP_ListOffsets   2
52 #define RD_KAFKAP_Metadata      3
53 #define RD_KAFKAP_LeaderAndIsr  4
54 #define RD_KAFKAP_StopReplica   5
55 #define RD_KAFKAP_UpdateMetadata 6
56 #define RD_KAFKAP_ControlledShutdown 7
57 #define RD_KAFKAP_OffsetCommit  8
58 #define RD_KAFKAP_OffsetFetch   9
59 #define RD_KAFKAP_FindCoordinator 10
60 #define RD_KAFKAP_JoinGroup     11
61 #define RD_KAFKAP_Heartbeat     12
62 #define RD_KAFKAP_LeaveGroup    13
63 #define RD_KAFKAP_SyncGroup     14
64 #define RD_KAFKAP_DescribeGroups 15
65 #define RD_KAFKAP_ListGroups    16
66 #define RD_KAFKAP_SaslHandshake 17
67 #define RD_KAFKAP_ApiVersion    18
68 #define RD_KAFKAP_CreateTopics  19
69 #define RD_KAFKAP_DeleteTopics  20
70 #define RD_KAFKAP_DeleteRecords 21
71 #define RD_KAFKAP_InitProducerId 22
72 #define RD_KAFKAP_OffsetForLeaderEpoch 23
73 #define RD_KAFKAP_AddPartitionsToTxn 24
74 #define RD_KAFKAP_AddOffsetsToTxn 25
75 #define RD_KAFKAP_EndTxn        26
76 #define RD_KAFKAP_WriteTxnMarkers 27
77 #define RD_KAFKAP_TxnOffsetCommit 28
78 #define RD_KAFKAP_DescribeAcls  29
79 #define RD_KAFKAP_CreateAcls    30
80 #define RD_KAFKAP_DeleteAcls    31
81 #define RD_KAFKAP_DescribeConfigs 32
82 #define RD_KAFKAP_AlterConfigs  33
83 #define RD_KAFKAP_AlterReplicaLogDirs 34
84 #define RD_KAFKAP_DescribeLogDirs 35
85 #define RD_KAFKAP_SaslAuthenticate 36
86 #define RD_KAFKAP_CreatePartitions 37
87 #define RD_KAFKAP_CreateDelegationToken 38
88 #define RD_KAFKAP_RenewDelegationToken 39
89 #define RD_KAFKAP_ExpireDelegationToken 40
90 #define RD_KAFKAP_DescribeDelegationToken 41
91 #define RD_KAFKAP_DeleteGroups 42
92 #define RD_KAFKAP_ElectLeaders 43
93 #define RD_KAFKAP_IncrementalAlterConfigs 44
94 #define RD_KAFKAP_AlterPartitionReassignments 45
95 #define RD_KAFKAP_ListPartitionReassignments 46
96 #define RD_KAFKAP_OffsetDelete 47
97 #define RD_KAFKAP_DescribeClientQuotas 48
98 #define RD_KAFKAP_AlterClientQuotas 49
99 #define RD_KAFKAP_DescribeUserScramCredentials 50
100 #define RD_KAFKAP_AlterUserScramCredentials 51
101 #define RD_KAFKAP_Vote 52
102 #define RD_KAFKAP_BeginQuorumEpoch 53
103 #define RD_KAFKAP_EndQuorumEpoch 54
104 #define RD_KAFKAP_DescribeQuorum 55
105 #define RD_KAFKAP_AlterIsr 56
106 #define RD_KAFKAP_UpdateFeatures 57
107 #define RD_KAFKAP_Envelope 58
108 #define RD_KAFKAP__NUM         59
109 
110 
111 #endif /* _RDKAFKA_PROTOCOL_H_ */
112