Network Services API  2.75.00.17
Data Structures | Macros | Typedefs | Functions
httpserver.h File Reference

Detailed Description

HTTP Server services.

#include <stdint.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <ti/net/slnetsock.h>
#include "urlhandler.h"
Include dependency graph for httpserver.h:

Go to the source code of this file.

Data Structures

struct  HTTPServer_Params
 HTTPServer instance create parameters. More...
 

Macros

#define HTTPServer_EACCEPTFAIL   (-2)
 Internal accept() call failed. More...
 
#define HTTPServer_ESOCKETFAIL   (-3)
 Internal network socket creation failure. More...
 
#define HTTPServer_EBINDFAIL   (-4)
 Internal bind() call failed. More...
 
#define HTTPServer_ELISTENFAIL   (-5)
 Internal listen() call failed. More...
 
#define HTTPServer_EMEMFAIL   (-6)
 Internal memory allocation or object creation failure. More...
 
#define HTTPServer_EMQFAIL   (-7)
 Internal mq creation failure. More...
 
#define HTTPServer_EMUTEXFAIL   (-8)
 Internal mutex-related failure. More...
 

Typedefs

typedef struct HTTPServer_Params HTTPServer_Params
 HTTPServer instance create parameters. More...
 
typedef struct HTTPServer_Object * HTTPServer_Handle
 HTTPServer instance object handle. More...
 

Functions

void HTTPServer_init (void)
 Initialize the HTTPServer module. More...
 
void HTTPServer_Params_init (HTTPServer_Params *params)
 Initialize the instance create params structure. More...
 
void HTTPServer_enableSecurity (HTTPServer_Handle srv, SlNetSockSecAttrib_t *securityAttributes, bool beginSecurely)
 Attach security params to the created, but not yet initialized server. More...
 
HTTPServer_Handle HTTPServer_create (const URLHandler_Setup *urlh, int numURLh, HTTPServer_Params *params)
 Create an HTTPServer instance. More...
 
void HTTPServer_delete (HTTPServer_Handle *srv)
 Delete an HTTPServer instance. More...
 
void HTTPServer_sendSimpleResponse (int s, int status, const char *type, size_t len, const void *buf)
 Send a simple, complete response to a client. More...
 
void HTTPServer_sendResponse (int s, int status, const char *headers[], int numHeaders, size_t len, const void *buf)
 Send a complete response to a client. More...
 
void HTTPServer_sendErrorResponse (int s, int status)
 Send an error response to a client. More...
 
void HTTPServer_sendResponseChunked (int s, int status, const char *type)
 Begin the process of sending a chunked response to a client. More...
 
void HTTPServer_sendChunk (int s, const void *buf, size_t len)
 Continue and complete the process of sending a chunked response to a client. More...
 
int HTTPServer_serveSelect (HTTPServer_Handle srv, const struct sockaddr *addr, int len, int backlog)
 Begin the HTTP Server's main processing loop. More...
 
bool HTTPServer_stop (HTTPServer_Handle srv, uint32_t timeout)
 Stop a currently running server. More...
 
bool HTTPServer_isSessionSecure (URLHandler_Session sess)
 Obtain the session's security status. More...
 
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale