MHEG5  15.3.0
source/http/src/http_header.c File Reference
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <glue_memory.h>
#include "http_header.h"

Data Structures

struct  sToken

Defines

#define MAX_FIELD_NAME   (32)
#define MAX_CONTENT_LENGTH   (24)
#define DBG(x)

Typedefs

typedef struct sToken Token

Enumerations

enum  TokenType {
  TOKEN_NUMBER = '0', TOKEN_BYTES = 'b', TOKEN_SPACE = ' ', TOKEN_HYPHEN = '-',
  TOKEN_SLASH = '/', TOKEN_ASTERISK = '*'
}

Functions

U8BIT * httpHdrParseFieldName (U8BIT *data, U32BIT len, E_HTTP_FIELD *field)
 Parse field for its name in an HTTP header.
U64BIT httpHdrParseContentLength (U8BIT *data, U32BIT len)
 Parse "Content-Length" header and return the content length in bytes.
U64BIT httpHdrParseContentRange (U8BIT *data, U32BIT len)
 Parse "Content-Range" header and return the content length in bytes.

Detailed Description

Date:
20/12/2012
Author:
Adam Sturtridge

Function Documentation

U64BIT httpHdrParseContentLength ( U8BIT *  data,
U32BIT  len 
)

Parse "Content-Length" header and return the content length in bytes.

Parameters:
dataHeader data
lenSize of header data in bytes
Returns:
Content length, invalid if cannot be parsed
U64BIT httpHdrParseContentRange ( U8BIT *  data,
U32BIT  len 
)

Parse "Content-Range" header and return the content length in bytes.

Parameters:
dataHeader data
lenSize of header data in bytes
Returns:
Content length, invalid if cannot be parsed
U8BIT* httpHdrParseFieldName ( U8BIT *  data,
U32BIT  len,
E_HTTP_FIELD *  field 
)

Parse field for its name in an HTTP header.

Parameters:
dataHeader data
lenSize of header data in bytes
fieldpointer to enum value for the field type
Returns:
byte pointer to beginning of field data
 All Data Structures Files Functions Variables Typedefs Defines