zephyr/samples/net/http_server/src/ssl_utils.h
Sergio Rodriguez de60e4c8cd samples/net/http: Add HTTP over TLS sample application
Add the HTTPS (HTTP over TLS) server sample application on top
of the current HTTP Parser Library and mbedTLS. This code uses
TLS to stablish a secure connection and HTTP parser to identify
the request and the proper response.

Jira: ZEP-799

Change-Id: Ifbbcd0347bec47d12158440e50a82dc2966334d3
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:35 +02:00

38 lines
737 B
C

/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _SSL_UTILS_H_
#define _SSL_UTILS_H_
#include <net/net_core.h>
#include <net/http_parser.h>
struct rx_fifo_block {
sys_snode_t snode;
struct k_mem_block block;
struct net_buf *buf;
};
struct ssl_context {
struct net_context *net_ctx;
struct net_buf *rx_nbuf;
struct net_buf *frag;
struct k_sem tx_sem;
struct k_fifo rx_fifo;
struct http_parser_settings parser_settings;
struct http_parser parser;
int remaining;
};
int ssl_init(struct ssl_context *ctx, void *addr);
int ssl_tx(void *ctx, const unsigned char *buf, size_t size);
int ssl_rx(void *ctx, unsigned char *buf, size_t size);
void https_server_start(void);
#endif