summaryrefslogtreecommitdiffstats
path: root/storage/maria/libmarias3/src/structs.h
blob: 30a7fff0551c90bed0047ef3efe425396f5d38dc (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 * Copyright 2019 MariaDB Corporation Ab. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 */

#pragma once

#include "config.h"

struct ms3_pool_alloc_list_st
{
  struct ms3_list_st *pool;
  struct ms3_pool_alloc_list_st *prev;
};

struct ms3_list_container_st
{
  struct ms3_list_st *pool;
  struct ms3_list_st *start;
  struct ms3_pool_alloc_list_st *pool_list;
  struct ms3_list_st *next;
  size_t pool_free;
};

struct ms3_st
{
  char *s3key;
  char *s3secret;
  char *region;
  char *base_domain;
  int port; // 0 means "Use default"

  char *sts_endpoint;
  char *sts_region;
  char *iam_endpoint;
  char *iam_role;
  char *role_key;
  char *role_secret;
  char *role_session_token;
  char *iam_role_arn;
  size_t role_session_duration;

  size_t buffer_chunk_size;
  CURL *curl;
  char *last_error;
  bool use_http;
  bool disable_verification;
  uint8_t list_version;
  uint8_t protocol_version;
  bool first_run;
  char *path_buffer;
  char *query_buffer;
  void *read_cb;
  void *user_data;
  struct ms3_list_container_st list_container;
};

struct memory_buffer_st
{
  uint8_t *data;
  size_t length;
  size_t alloced;
  size_t buffer_chunk_size;
};

struct put_buffer_st
{
  const uint8_t *data;
  size_t length;
  size_t offset;
};