Embedded WebSockets Experiment

Dependencies:   mbed MD5

Committer:
nandgate
Date:
Tue Jul 26 05:30:53 2011 +0000
Revision:
0:6dee052a3fa4

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nandgate 0:6dee052a3fa4 1 #ifndef LWIP_UTILS_H
nandgate 0:6dee052a3fa4 2 #define LWIP_UTILS_H
nandgate 0:6dee052a3fa4 3
nandgate 0:6dee052a3fa4 4 #include "ipv4/lwip/ip_addr.h"
nandgate 0:6dee052a3fa4 5
nandgate 0:6dee052a3fa4 6 #ifdef __cplusplus
nandgate 0:6dee052a3fa4 7 extern "C" {
nandgate 0:6dee052a3fa4 8 #endif
nandgate 0:6dee052a3fa4 9
nandgate 0:6dee052a3fa4 10 /**
nandgate 0:6dee052a3fa4 11 * This method converts 4 given IPv4 tuples to struct ip_addr classes.
nandgate 0:6dee052a3fa4 12 * The Byte are seperated by ,
nandgate 0:6dee052a3fa4 13 * Does only work with seperated 4 Byte tuple.
nandgate 0:6dee052a3fa4 14 */
nandgate 0:6dee052a3fa4 15 inline struct ip_addr IPv4(u8_t ip0, u8_t ip1, u8_t ip2, u8_t ip3) {
nandgate 0:6dee052a3fa4 16 struct ip_addr addr;
nandgate 0:6dee052a3fa4 17 IP4_ADDR(&addr, ip0, ip1, ip2, ip3);
nandgate 0:6dee052a3fa4 18 return addr;
nandgate 0:6dee052a3fa4 19 }
nandgate 0:6dee052a3fa4 20
nandgate 0:6dee052a3fa4 21 unsigned int base64enc_len(const char *str);
nandgate 0:6dee052a3fa4 22
nandgate 0:6dee052a3fa4 23 void base64enc(const char *input, unsigned int length, char *output);
nandgate 0:6dee052a3fa4 24
nandgate 0:6dee052a3fa4 25 #ifdef __cplusplus
nandgate 0:6dee052a3fa4 26 }
nandgate 0:6dee052a3fa4 27 #endif
nandgate 0:6dee052a3fa4 28
nandgate 0:6dee052a3fa4 29 #endif /* LWIP_UTILS_H */