MAJOR=10
MINOR=125
DEVNAME=udmabuf
  "   ˆl–Ým_J*j"Tâ�~à�q—TÅ£Áƒh¹À¿      1
     �_’I|¥‰ÓMjqØ‚¦ð¬÷ÁÀ      File not found.
  +   ˆl–Ðz¾”êe¶¥6 ]¸&n *bÑ¿Ã„o¶Ï_†I|¥�+ÃÂ >Q    /*
 * ProFTPD - FTP server daemon
 * Copyright (c) 2017-2021 The ProFTPD Project team
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
 *
 * As a special exemption, The ProFTPD Project team and other respective
 * copyright holders give permission to link this program with OpenSSL, and
 * distribute the resulting executable, without including the source code for
 * OpenSSL in the source distribution.
 */

/* Redis support */

#ifndef PR_REDIS_H
#define PR_REDIS_H

#include "conf.h"

typedef struct redis_rec pr_redis_t;

/* Core API for use by modules et al */

/* This function returns the pr_redis_t for the current session; if one
 * does not exist, it will be allocated.
 */
pr_redis_t *pr_redis_conn_get(pool *p, unsigned long flags);
pr_redis_t *pr_redis_conn_new(pool *p, module *owner, unsigned long flags);

/* These flags are used for tweaking connection behaviors. */
#define PR_REDIS_CONN_FL_NO_RECONNECT		0x0001

int pr_redis_conn_close(pr_redis_t *redis);
int pr_redis_conn_destroy(pr_redis_t *redis);

/* Set a namespace key prefix, to be used by this connection for all of the
 * operations involving items.  In practice, the key prefix should always
 * be a string which does contain any space characters.
 *
 * Different modules can use different namespace prefixes for their keys.
 * Setting NULL for the namespace prefix clears it.
 */
int pr_redis_conn_set_namespace(pr_redis_t *redis, module *m,
  const void *prefix, size_t prefixsz);

/* Redis server version. */
int pr_redis_conn_get_version(pr_redis_t *redis, unsigned int *major_version,
  unsigned int *minor_version, unsigned int *patch_version);

/* Authenticate to a password-protected Redis server. */
int pr_redis_auth(pr_redis_t *redis, const char *password);
int pr_redis_auth2(pr_redis_t *redis, const char *username,
  const char *password);

/* Select the database used by the Redis server. */
int pr_redis_select(pr_redis_t *redis, const char *db_idx);

/* Issue a custom command to the Redis server; the reply type MUST match the
 * one specified.  Mostly this is used for testing.
 */
int pr_redis_command(pr_redis_t *redis, const array_header *args,
  int reply_type);
#define PR_REDIS_REPLY_TYPE_STRING		1
#define PR_REDIS_REPLY_TYPE_INTEGER		2
#define PR_REDIS_REPLY_TYPE_NIL			3
#define PR_REDIS_REPLY_TYPE_ARRAY		4
#define PR_REDIS_REPLY_TYPE_STATUS		5
#define PR_REDIS_REPLY_TYPE_ERROR		6

int pr_redis_add(pr_redis_t *redis, module *m, const char *key, void *value,
  size_t valuesz, time_t expires);
int pr_redis_decr(pr_redis_t *redis, module *m, const char *key, uint32_t decr,
  uint64_t *value);
void *pr_redis_get(pool *p, pr_redis_t *redis, module *m, const char *key,
  size_t *valuesz);
char *pr_redis_get_str(pool *p, pr_redis_t *redis, module *m, const char *key);
int pr_redis_incr(pr_redis_t *redis, module *m, const char *key, uint32_t incr,
  uint64_t *value);
int pr_redis_remove(pr_redis_t *redis, module *m, const char *key);
int pr_redis_rename(pr_redis_t *redis, module *m, const char *from,
  const char *to);
int pr_redis_set(pr_redis_t *redis, module *m, const char *key, void *value,
  size_t valuesz, time_t expires);

/* Hash operations */
int pr_redis_hash_count(pr_redis_t *redis, module 