Smart Home firewall
Profile-based Smart Home firewall
Classes | Macros | Typedefs | Enumerations | Functions
ssdp.h File Reference

SSDP message parser. More...

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <arpa/inet.h>
#include "packet_utils.h"
Include dependency graph for ssdp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ssdp_message
 

Macros

#define SSDP_METHOD_MAX_LEN   8
 
#define SSDP_MULTICAST_ADDR   "239.255.255.250"
 

Typedefs

typedef struct ssdp_message ssdp_message_t
 

Enumerations

enum  ssdp_method_t { SSDP_M_SEARCH , SSDP_NOTIFY , SSDP_UNKNOWN }
 

Functions

ssdp_message_t ssdp_parse_message (uint8_t *data, uint32_t dst_addr)
 Parse the method and URI of SSDP message. More...
 
char * ssdp_method_to_str (ssdp_method_t method)
 Converts a SSDP method from enum value to character string. More...
 
void ssdp_print_message (ssdp_message_t message)
 Print the method and URI of a SSDP message. More...
 

Detailed Description

SSDP message parser.

Date
2022-11-24

Typedef Documentation

◆ ssdp_message_t

typedef struct ssdp_message ssdp_message_t

Abstraction of an SSDP message

Enumeration Type Documentation

◆ ssdp_method_t

SSDP methods

Function Documentation

◆ ssdp_method_to_str()

char* ssdp_method_to_str ( ssdp_method_t  method)

Converts a SSDP method from enum value to character string.

Parameters
methodthe SSDP method in enum value
Returns
the same SSDP method as a character string

◆ ssdp_parse_message()

ssdp_message_t ssdp_parse_message ( uint8_t *  data,
uint32_t  dst_addr 
)

Parse the method and URI of SSDP message.

Parameters
datapointer to the start of the SSDP message
dst_addrIPv4 destination address, in network byte order
Returns
the parsed SSDP message

◆ ssdp_print_message()

void ssdp_print_message ( ssdp_message_t  message)

Print the method and URI of a SSDP message.

Parameters
messagethe message to print