All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_info.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2016 Aerospike, Inc.
3  *
4  * Portions may be licensed to Aerospike, Inc. under one or more contributor
5  * license agreements.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8  * use this file except in compliance with the License. You may obtain a copy of
9  * the License at 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, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 #pragma once
18 
19 #include <aerospike/as_cluster.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /******************************************************************************
26  * TYPES
27  *****************************************************************************/
28 
29 /**
30  * @private
31  * Name value pair.
32  */
33 typedef struct as_name_value_s {
34  char* name;
35  char* value;
37 
38 struct sockaddr_in;
39 
40 /******************************************************************************
41  * FUNCTIONS
42  ******************************************************************************/
43 
44 /**
45  * @private
46  * Send info command to specific node. The values must be freed by the caller on success.
47  */
49 as_info_command_node(as_error* err, as_node* node, char* command, bool send_asis, uint64_t deadline_ms, char** response);
50 
51 /**
52  * @private
53  * Send info command to specific host. The values must be freed by the caller on success.
54  */
56 as_info_command_host(as_cluster* cluster, as_error* err, struct sockaddr_in* sa_in, char* command,
57  bool send_asis, uint64_t deadline_ms, char** response);
58 
59 /**
60  * @private
61  * Send info command to specific socket. The values must be freed by the caller on success.
62  * Set max_response_length to zero if response size should not be bounded.
63  */
65 as_info_command(as_error* err, int fd, char* names, bool send_asis, uint64_t deadline_ms,
66  uint64_t max_response_length, char** values);
67 
68 /**
69  * @private
70  * Create and authenticate socket for info requests.
71  */
73 as_info_create_socket(as_cluster* cluster, as_error* err, struct sockaddr_in* sa_in,
74  uint64_t deadline_ms, int* fd_out);
75 
76 /**
77  * @private
78  * Return the single command's info response buffer value.
79  * The original buffer will be modified with the null termination character.
80  */
82 as_info_parse_single_response(char *values, char **value);
83 
84 /**
85  * @private
86  * Parse info response buffer into name/value pairs, one for each command.
87  * The original buffer will be modified with null termination characters to
88  * delimit each command name and value referenced by the name/value pairs.
89  */
90 void
91 as_info_parse_multi_response(char* buf, as_vector* /* <as_name_value> */ values);
92 
93 #ifdef __cplusplus
94 } // end extern "C"
95 #endif