/* SPDX-License-Identifier: GPL-2.0-or-later */
/*!
 * @brief Event API for sstp-client
 *
 * @file sstp-event.c
 *
 * @author Copyright (C) 2011 Eivind Naess, 
 *      All Rights Reserved
 */
#ifndef __SSTP_EVENT_H__
#define __SSTP_EVENT_H__

/*< Forward declare event context */
struct sstp_event;
typedef struct sstp_event sstp_event_st;


/*!
 * @brief A callback function for when waiting for ip-up from pppd
 */
typedef void (*sstp_event_fn)(void *ctx, int status);


/*!
 * @brief Create an event to listen for callback
 */
status_t sstp_event_create(sstp_event_st **ctx, sstp_option_st *opts,
        event_base_st *base, sstp_event_fn event_cb, void *arg);


/*! 
 * @brief Get the socket name for the callback
 */
const char *sstp_event_sockname(sstp_event_st *ctx);


/*!
 * @brief Get the results from the event
 */
status_t sstp_event_mppe_result(sstp_event_st *ctx, uint8_t **send_key, 
        uint8_t **recv_key, size_t *key_len);

/*!
 * @brief Shutdown and remove the socket
 */
void sstp_event_free(sstp_event_st *ctx);


#endif
