#ifndef CONFIGNIO_H #define CONFIGNIO_H #include "stm.h" #include "cmd.h" #define BUFF_SIZE 4096 struct cmd_st { /** buffer utilizado para I/O */ buffer *rb, *wb; struct cmd_parser parser; /** el método de autenticación seleccionado */ uint8_t cmd; /** está verificado */ uint8_t verified; uint8_t status; }; struct config { struct sockaddr_storage client_addr; socklen_t client_addr_len; /** maquinas de estados */ struct state_machine stm; union { struct cmd_st cmd; } client; // TODO: decidir tamaño del buffer uint8_t raw_buff_a[BUFF_SIZE], raw_buff_b[BUFF_SIZE]; buffer read_buffer, write_buffer; unsigned references; struct config * next; }; void config_read(struct selector_key *key); void config_write(struct selector_key *key); #endif