#ifndef DPP_H
#define DPP_H

#if (EASYMESH_VERSION >= 3)

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

struct uloop_fd;
struct controller;

#define FRAME_DST_ENROLLEE(type) \
		((type == DPP_PA_AUTHENTICATION_REQ) || \
		 (type == DPP_PA_AUTHENTICATION_CONF))

#define DPP_URI_FILE "/etc/multiap/dpp_uris.json"


#define ZT_PASSPHRASE_MOD_SUCCESS       0
#define ZT_PASSPHRASE_MOD_EXISTS        1
#define ZT_PASSPHRASE_MOD_ERROR        -1

enum dpp_event;

const char *dpp_frame_type2str(uint8_t type);
char *dppfile_gen_alias(char *alias_buf, size_t buf_len);
int dpp_mod_enrollee(struct controller *c, const char *key,
			       const char *alias, const char *uri,
			       bool add);
#ifdef ZEROTOUCH_DPP
int zerotouch_add_enrollee_key(struct controller *c, const char *key, const char *alias);
int zerotouch_del_enrollee_key(struct controller *c, const char *key, const char *alias);
#endif

int dpp_append_enrollee_uri(struct controller *c, const char *uri, const char *alias);
int dpp_cntlr_read_enrollees(struct controller *c);

void dpp_event_uloop_cb(struct uloop_fd *fd, unsigned int events);

int dpp_frame_handler(void *dpp, uint8_t *smac, enum dpp_event ev,
		      uint8_t *frame, size_t framelen);
#endif
#endif
