#ifndef LAMP_TICKET_DISPATCH_H
#define LAMP_TICKET_DISPATCH_H

#include "lamp_guard.h"

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

typedef bool (*lamp_ticket_send_fn)(void *context, const uint8_t *packet,
                                    size_t length);

typedef enum {
    LAMP_TICKET_DISPATCH_NOT_READY = 0,
    LAMP_TICKET_DISPATCH_QUEUED,
    LAMP_TICKET_DISPATCH_SEND_FAILED,
    LAMP_TICKET_DISPATCH_INVALID_ARGUMENT
} lamp_ticket_dispatch_status;

/* QUEUED means accepted by the local TX queue; it does not prove wire delivery.
 * A queue failure stops the guard and clears any active policy output. */
lamp_ticket_dispatch_status lamp_ticket_dispatch_issue(
    lg_guard *guard, uint32_t now_ms, lamp_ticket_send_fn send_packet,
    void *send_context);

#endif
