Commit e46e6503 authored by roel0's avatar roel0

Merge branch 'development' of https://github.com/tass-belgium/picotcp into development

parents 60efbcf2 3c295364
......@@ -7,7 +7,7 @@ AR:=$(CROSS_COMPILE)ar
RANLIB:=$(CROSS_COMPILE)ranlib
SIZE:=$(CROSS_COMPILE)size
STRIP_BIN:=$(CROSS_COMPILE)strip
TEST_LDFLAGS=-pthread $(PREFIX)/modules/*.o $(PREFIX)/lib/*.o -lvdeplug -lpcap
TEST_LDFLAGS=-pthread $(PREFIX)/modules/*.o $(PREFIX)/lib/*.o -lvdeplug -m32
LIBNAME:="libpicotcp.a"
PREFIX?=$(PWD)/build
......@@ -17,8 +17,9 @@ PERF?=0
ENDIAN?=little
STRIP?=0
RTOS?=0
CHECKSUMFUN?=young
ADDRESS_SANITIZER?=0
GENERIC?=0
PTHREAD?=0
ADDRESS_SANITIZER?=1
# Default compiled-in protocols
#
......@@ -36,6 +37,7 @@ DHCP_CLIENT?=1
DHCP_SERVER?=1
DNS_CLIENT?=1
MDNS?=1
DNS_SD?=1
SNTP_CLIENT?=1
IPFILTER?=1
CRC?=1
......@@ -47,6 +49,10 @@ MEMORY_MANAGER?=0
MEMORY_MANAGER_PROFILING?=0
TUN?=0
TAP?=0
PCAP?=0
PPP?=1
CYASSL?=0
POLARSSL?=0
#IPv6 related
IPV6?=1
......@@ -59,6 +65,8 @@ CFLAGS=-I$(PREFIX)/include -Iinclude -Imodules -Wall -Wdeclaration-after-stateme
CFLAGS+= -Wconversion
# request from Toon
CFLAGS+= -Wcast-align
CFLAGS+= -Wmissing-prototypes
ifeq ($(DEBUG),1)
CFLAGS+=-ggdb
......@@ -80,17 +88,21 @@ ifeq ($(TFTP),1)
endif
ifeq ($(AODV),1)
MOD_OBJ+=$(LIBBASE)modules/pico_aodv.o
MOD_OBJ+=$(LIBBASE)modules/pico_aodv.o
OPTIONS+=-DPICO_SUPPORT_AODV
endif
ifeq ($(GENERIC),1)
CFLAGS+=-DGENERIC
endif
ifneq ($(ENDIAN),little)
CFLAGS+=-DPICO_BIGENDIAN
ifeq ($(PTHREAD),1)
CFLAGS+=-DPICO_SUPPORT_PTHREAD
endif
ifeq ($(CHECKSUMFUN),young)
CFLAGS+=-DPICO_YOUNG_CHECKSUM
ifneq ($(ENDIAN),little)
CFLAGS+=-DPICO_BIGENDIAN
endif
ifneq ($(RTOS),0)
......@@ -114,12 +126,12 @@ ifeq ($(ARCH),arm9)
endif
ifeq ($(ADDRESS_SANITIZER),1)
CFLAGS+=-fsanitize=address -fno-omit-frame-pointer -m32
TEST_LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer -m32
endif
ifeq ($(ARCH),faulty)
CFLAGS+=-DFAULTY -DUNIT_TEST
CFLAGS+=-fsanitize=address -fno-omit-frame-pointer -m32
UNITS_OBJ+=test/pico_faulty.o
TEST_OBJ+=test/pico_faulty.o
DUMMY_EXTRA+=test/pico_faulty.o
......@@ -133,6 +145,10 @@ ifeq ($(ARCH),esp8266)
CFLAGS+=-DESP8266 -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals
endif
ifeq ($(ARCH),mt7681)
CFLAGS+=-DMT7681 -fno-builtin -ffunction-sections -fno-strict-aliasing -m16bit -mabi=2 -mbaseline=V2 -mcpu=n9 -mno-div -mel -mmw-count=8 -mno-ext-mac -mno-dx-regs
endif
ifeq ($(ARCH),pic24)
CFLAGS+=-DPIC24 -c -mcpu=24FJ256GA106 -MMD -MF -g -omf=elf \
-mlarge-code -mlarge-data -msmart-io=1 -msfr-warn=off
......@@ -159,14 +175,13 @@ CORE_OBJ= stack/pico_stack.o \
stack/pico_protocol.o \
stack/pico_socket.o \
stack/pico_socket_multicast.o \
stack/pico_tree.o
stack/pico_tree.o \
stack/pico_md5.o
POSIX_OBJ+= modules/pico_dev_vde.o \
modules/pico_dev_tun.o \
modules/pico_dev_tap.o \
modules/pico_dev_mock.o \
modules/pico_dev_pcap.o \
modules/ptsocket/pico_ptsocket.o
modules/pico_dev_mock.o
ifneq ($(ETH),0)
include rules/eth.mk
......@@ -208,6 +223,9 @@ endif
ifneq ($(MDNS),0)
include rules/mdns.mk
endif
ifneq ($(DNS_SD),0)
include rules/dns_sd.mk
endif
ifneq ($(IPFILTER),0)
include rules/ipfilter.mk
endif
......@@ -238,6 +256,18 @@ endif
ifneq ($(TAP),0)
include rules/tap.mk
endif
ifneq ($(PCAP),0)
include rules/pcap.mk
endif
ifneq ($(PPP),0)
include rules/ppp.mk
endif
ifneq ($(CYASSL),0)
include rules/cyassl.mk
endif
ifneq ($(POLARSSL),0)
include rules/polarssl.mk
endif
all: mod core lib
......@@ -251,20 +281,19 @@ mod: $(MOD_OBJ)
posix: all $(POSIX_OBJ)
@mv modules/*.o $(PREFIX)/modules || echo
@mv modules/ptsocket/*.o $(PREFIX)/modules || echo
TEST_ELF= test/picoapp.elf
TEST6_ELF= test/picoapp6.elf
test: posix
test: posix
@mkdir -p $(PREFIX)/test/
@make -C test/examples PREFIX=$(PREFIX)
@echo -e "\t[CC] picoapp.o"
@gcc -c -o $(PREFIX)/examples/picoapp.o test/picoapp.c $(CFLAGS)
@$(CC) -c -o $(PREFIX)/examples/picoapp.o test/picoapp.c $(CFLAGS) -Itest/examples
@echo -e "\t[LD] [email protected]"
@$(CC) -o $(TEST_ELF) -I include -I modules -I $(PREFIX)/include -Wl,--start-group $(TEST_LDFLAGS) $(TEST_OBJ) $(PREFIX)/examples/*.o -Wl,--end-group
@$(CC) -g -o $(TEST_ELF) -I include -I modules -I $(PREFIX)/include -Wl,--start-group $(TEST_LDFLAGS) $(TEST_OBJ) $(PREFIX)/examples/*.o -Wl,--end-group
@mv test/*.elf $(PREFIX)/test
@install $(PREFIX)/$(TEST_ELF) $(PREFIX)/$(TEST6_ELF)
......@@ -286,12 +315,12 @@ lib: mod core
@cp -f modules/*.h $(PREFIX)/include
@echo -e "\t[AR] $(PREFIX)/lib/$(LIBNAME)"
@$(AR) cru $(PREFIX)/lib/$(LIBNAME) $(PREFIX)/modules/*.o $(PREFIX)/lib/*.o \
|| $(AR) cru $(PREFIX)/lib/$(LIBNAME) $(PREFIX)/lib/*.o
|| $(AR) cru $(PREFIX)/lib/$(LIBNAME) $(PREFIX)/lib/*.o
@echo -e "\t[RANLIB] $(PREFIX)/lib/$(LIBNAME)"
@$(RANLIB) $(PREFIX)/lib/$(LIBNAME)
@test $(STRIP) -eq 1 && (echo -e "\t[STRIP] $(PREFIX)/lib/$(LIBNAME)" \
&& $(STRIP_BIN) $(PREFIX)/lib/$(LIBNAME)) \
|| echo -e "\t[KEEP SYMBOLS] $(PREFIX)/lib/$(LIBNAME)"
|| echo -e "\t[KEEP SYMBOLS] $(PREFIX)/lib/$(LIBNAME)"
@echo -e "\t[LIBSIZE] `du -b $(PREFIX)/lib/$(LIBNAME)`"
@echo -e "`size -t $(PREFIX)/lib/$(LIBNAME)`"
......@@ -306,13 +335,17 @@ units: mod core lib $(UNITS_OBJ) $(MOD_OBJ)
@echo -e "\t[CC] units.o"
@$(CC) -c -o $(PREFIX)/test/units.o test/units.c $(CFLAGS) -I stack -I modules -I includes -I test/unit -DUNIT_TEST
@echo -e "\t[LD] $(PREFIX)/test/units"
@$(CC) -o $(PREFIX)/test/units $(CFLAGS) $(PREFIX)/test/units.o -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/modules/pico_aodv.o
@$(CC) -o $(PREFIX)/test/units $(CFLAGS) $(PREFIX)/test/units.o -lcheck -lm -pthread -lrt \
$(UNITS_OBJ) $(PREFIX)/modules/pico_aodv.o \
$(PREFIX)/modules/pico_fragments.o
@$(CC) -o $(PREFIX)/test/modunit_pico_protocol.elf $(CFLAGS) -I. test/unit/modunit_pico_protocol.c stack/pico_tree.c -lcheck -lm -pthread -lrt $(UNITS_OBJ)
@$(CC) -o $(PREFIX)/test/modunit_pico_frame.elf $(CFLAGS) -I. test/unit/modunit_pico_frame.c stack/pico_tree.c -lcheck -lm -pthread -lrt $(UNITS_OBJ)
@$(CC) -o $(PREFIX)/test/modunit_seq.elf $(CFLAGS) -I. test/unit/modunit_seq.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_tcp.elf $(CFLAGS) -I. test/unit/modunit_pico_tcp.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_dns_client.elf $(CFLAGS) -I. test/unit/modunit_pico_dns_client.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_dns_common.elf $(CFLAGS) -I. test/unit/modunit_pico_dns_common.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_mdns.elf $(CFLAGS) -I. test/unit/modunit_pico_mdns.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_dns_sd.elf $(CFLAGS) -I. test/unit/modunit_pico_dns_sd.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_dev_loop.elf $(CFLAGS) -I. test/unit/modunit_pico_dev_loop.c -lcheck -lm -pthread -lrt $(UNITS_OBJ)
@$(CC) -o $(PREFIX)/test/modunit_ipv6_nd.elf $(CFLAGS) -I. test/unit/modunit_pico_ipv6_nd.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_pico_stack.elf $(CFLAGS) -I. test/unit/modunit_pico_stack.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
......@@ -320,7 +353,9 @@ units: mod core lib $(UNITS_OBJ) $(MOD_OBJ)
@$(CC) -o $(PREFIX)/test/modunit_sntp_client.elf $(CFLAGS) -I. test/unit/modunit_pico_sntp_client.c -lcheck -lm -pthread -lrt $(UNITS_OBJ)
@$(CC) -o $(PREFIX)/test/modunit_ipfilter.elf $(CFLAGS) -I. test/unit/modunit_pico_ipfilter.c stack/pico_tree.c -lcheck -lm -pthread -lrt $(UNITS_OBJ)
@$(CC) -o $(PREFIX)/test/modunit_aodv.elf $(CFLAGS) -I. test/unit/modunit_pico_aodv.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_fragments.elf $(CFLAGS) -I. test/unit/modunit_pico_fragments.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
@$(CC) -o $(PREFIX)/test/modunit_queue.elf $(CFLAGS) -I. test/unit/modunit_queue.c -lcheck -lm -pthread -lrt $(UNITS_OBJ)
@$(CC) -o $(PREFIX)/test/modunit_dev_ppp.elf $(CFLAGS) -I. test/unit/modunit_pico_dev_ppp.c -lcheck -lm -pthread -lrt $(UNITS_OBJ) $(PREFIX)/lib/libpicotcp.a
devunits: mod core lib
@echo -e "\n\t[UNIT TESTS SUITE: device drivers]"
......@@ -350,7 +385,7 @@ mbed:
@cp include/pico_socket.h include/socket.tmp
@echo "#define MBED\n" > include/mbed.tmp
@cat include/mbed.tmp include/socket.tmp > include/pico_socket.h
@zip -0 PicoTCP.zip -r include modules stack -x include/arch/ include/arch/* include/pico_config.h include/*.tmp modules/ptsocket/* modules/ptsocket/ modules/ptsocket/test/ modules/ptsocket/test/* modules/pico_dev_*
@zip -0 PicoTCP.zip -r include modules stack -x include/arch/ include/arch/* include/pico_config.h include/*.tmp modules/pico_dev_*
@rm include/pico_socket.h include/mbed.tmp
@mv include/socket.tmp include/pico_socket.h
......@@ -362,9 +397,14 @@ style:
dummy: mod core lib $(DUMMY_EXTRA)
@echo testing configuration...
@$(CC) -c -o test/dummy.o test/dummy.c $(CFLAGS)
@$(CC) -o dummy test/dummy.o $(DUMMY_EXTRA) $(PREFIX)/lib/libpicotcp.a $(LDFLAGS)
@$(CC) -o dummy test/dummy.o $(DUMMY_EXTRA) $(PREFIX)/lib/libpicotcp.a $(LDFLAGS) $(CFLAGS)
@echo done.
@rm -f test/dummy.o dummy
@rm -f test/dummy.o dummy
ppptest: test/ppp.c lib
gcc -ggdb -c -o ppp.o test/ppp.c -I build/include/ -I build/modules/
gcc -o ppp ppp.o build/lib/libpicotcp.a $(LDFLAGS)
rm -f ppp.o
FORCE:
......@@ -4,16 +4,16 @@ picoTCP
Welcome to the one and only <font color=ff00f0>picoTCP repository</font>.
picoTCP is a TCP/IP stack designed for embedded systems developed by *[Altran Intelligent Systems](http://intelligent-systems.altran.com/)*
picoTCP is a small-footprint, modular TCP/IP stack designed for embedded systems and the Internet of Things. It's actively being developed by *[Altran Intelligent Systems](http://intelligent-systems.altran.com/)*.
This code is released under the terms of GNU GPL v2 only. Some rights reserved.
Other licenses may apply at the sole discretion of the copyright holders.
The getting started guide can be found on the GitHub wiki (https://github.com/tass-belgium/picotcp/wiki)
Learn how to use picoTCP in your project by going through the Getting Started guide on our [GitHub wiki](https://github.com/tass-belgium/picotcp/wiki).
For more information, visit [the project's website](http://www.picotcp.com)
For more information visit the [picoTCP website](http://www.picotcp.com), send us an email or contact us on [Twitter](https://twitter.com/picotcp), [Facebook](https://www.facebook.com/picoTCP) or [Reddit](http://www.reddit.com/r/picotcp/).
[Check our code quality](http://95.138.172.54:42506/TIOBEPortal/TICS/treeviewer?)
Wondering about picoTCP's code quality? Check [our TiCS score](http://tics.picotcp.com:42506/TIOBEPortal/TICS/treeviewer?)
---------------
......@@ -21,17 +21,13 @@ For more information, visit [the project's website](http://www.picotcp.com)
Continuous integration
Jenkins Functional tests:
[![Jenkins autotest](http://162.13.84.104:8080/buildStatus/icon?job=PicoTCP_rel_autotest)](http://162.13.84.104:8080/job/PicoTCP_rel_autotest)
[![Jenkins autotest](http://jenkins.picotcp.com:8080/buildStatus/icon?job=PicoTCP_rel_autotest)](http://jenkins.picotcp.com:8080/job/PicoTCP_rel_autotest)
Jenkins Unit tests :
[![Jenkins unit tests](http://162.13.84.104:8080/buildStatus/icon?job=PicoTCP_rel_unit_tests)](http://162.13.84.104:8080/job/PicoTCP_rel_unit_tests)
[![Jenkins unit tests](http://jenkins.picotcp.com:8080/buildStatus/icon?job=PicoTCP_rel_unit_tests)](http://jenkins.picotcp.com:8080/job/PicoTCP_rel_unit_tests)
Jenkins RFC compliance :
[![Jenkins RFC Compliance](http://162.13.84.104:8080/buildStatus/icon?job=PicoTCP_rel_RF_mbed)](http://162.13.84.104:8080/job/PicoTCP_rel_RF_mbed)
[![Jenkins RFC Compliance](http://jenkins.picotcp.com:8080/buildStatus/icon?job=PicoTCP_rel_RF_mbed)](http://jenkins.picotcp.com:8080/job/PicoTCP_rel_RF_mbed)
Jenkins TICS quality :
[![Jenkins TICS](http://162.13.84.104:8080/buildStatus/icon?job=PicoTCP_rel_TICS)](http://162.13.84.104:8080/job/PicoTCP_rel_TICS/)
Travis:
[![Travis CI build status](https://api.travis-ci.org/tass-belgium/picotcp.svg)](https://travis-ci.org/tass-belgium/picotcp)
[![Coverage Status](https://img.shields.io/coveralls/tass-belgium/picotcp.svg)](https://coveralls.io/r/tass-belgium/picotcp?branch=master)
[![Jenkins TICS](http://jenkins.picotcp.com:8080/buildStatus/icon?job=PicoTCP_rel_TICS)](http://jenkins.picotcp.com:8080/job/PicoTCP_rel_TICS/)
wget http://tools.ietf.org/rfc/rfc4614.txt
#!/bin/sh
wget -O rfc4614.txt http://tools.ietf.org/rfc/rfc4614.txt
for RFC in `grep "\[RFC" rfc4614.txt | sed -e "s/^.*RFC/rfc/" | grep -v "rfc \|rfc$" | sed -e "s/\].*$//g" |sort |uniq`; do
wget http://tools.ietf.org/rfc/$RFC.txt
for RFC in `grep "\[RFC" rfc4614.txt | sed -e "s/^.*RFC/rfc/" | grep -v "rfc \|rfc$" | sed -e "s/\].*$/.txt/g" |sort |uniq`; do
wget -O ${RFC} http://tools.ietf.org/rfc/${RFC}
done
wget http://tools.ietf.org/rfc/rfc3927.txt
wget -O rfc3927.txt http://tools.ietf.org/rfc/rfc3927.txt
# Get PPP related RFC's
for RFC in $(echo 1332 1334 1661 1662 1877 1994 | sed -r "s/[^ ]+/rfc&.txt/g"); do
wget -O ${RFC} http://tools.ietf.org/rfc/${RFC}
done
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -144,20 +144,21 @@ only be called after a callback occurred with code \texttt{PICO\_DHCP\_SUCCESS}.
\subsection{pico\_dhcp\_get\_nameserver}
\subsubsection*{Description}
Get the address of the nameserver that was assigned through DHCP. This function should
only be called after a callback occurred with code \texttt{PICO\_DHCP\_SUCCESS}.
Get the address of the first or the second nameserver that was assigned through DHCP.
This function should only be called after a callback occurred with code \texttt{PICO\_DHCP\_SUCCESS}.
\subsubsection*{Function prototype}
\texttt{struct pico\_ip4 pico\_dhcp\_get\_nameserver(void *cli);}
\texttt{struct pico\_ip4 pico\_dhcp\_get\_nameserver(void *cli, int index);}
\subsubsection*{Parameters}
\begin{itemize}[noitemsep]
\item \texttt{cli} - the identifier that was provided by the callback on \texttt{PICO\_DHCP\_SUCCESS}.
\item \texttt{index} - the indes of the domain name server received. Can be either "0" or "1".
\end{itemize}
\subsubsection*{Return value}
\begin{itemize}[noitemsep]
\item \texttt{struct pico\_ip4} - the address of the nameserver that should be used.
\item \texttt{struct pico\_ip4} - the address of the nameserver that should be used. On failure, e.g. an invalid index was passed, it returns "255.255.255.255". If the IP address of the DNS has not been set, it may return INADDR\_ANY.
\end{itemize}
......
\section{DNS SD client}
% Short description/overview of module functions
With this module DNS-SD services can be registered on the network to allow Zero Configuration Networking on the device. This is merely a small layer on top of Multicast DNS.
\subsection{pico$\_$dns$\_$sd$\_$init}
\subsubsection*{Description}
Just calls pico$\_$mdns$\_$init in its turn to initialise the mDNS-module. See 'pico$\_$mdns$\_$init' for more information.
\subsection{pico$\_$dns$\_$sd$\_$register$\_$service}
\subsubsection*{Description}
Registers the service with a certain name and type on the network via Multicast DNS.
\subsubsection*{Function prototype}
\begin{verbatim}
int pico_dns_sd_register_service( const char *name,
const char *type,
uint16_t port,
kv_vector *txt_data,
uint16_t ttl,
void (*callback)(pico_mdns_rtree *,char *,void *),
void *arg);
\end{verbatim}
\subsubsection*{Parameters}
\begin{itemize}[noitemsep]
\item \texttt{name} - Instance-name of the service. Use a descriptive name for it but not longer than 63 characters.
\item \texttt{type} - The type of the service. For all the possible service types see: \url{http://www.dns-sd.org/servicetypes.html}
\item \texttt{port} - The portnumber on which the service runs.
\item \texttt{txt$\_$data} - Pointer to vector with key-value pairs to insert into the TXT record to give additional information about the service. Use the 'PICO$\_$DNS$\_$SD$\_$KV$\_$VECTOR$\_$DECLARE'-macro to declare a vector for key-value-pairs. This vector will be destroyed when the function returns since there's no need in keeping the contents.
\item \texttt{ttl} - TTL of the service on the network before it needs to be reconfirmed. In seconds.
\item \texttt{callback} - Callback function that gets called when the service is successfully registered on the network.
\item \texttt{arg} - Argument for callback supplied by user. This can be used if you want to pass some variable into your callback function.
\end{itemize}
\subsubsection*{Return value}
Returns 0 when the module successfully started registering the service, something else on failure. \texttt{pico$\_$err} is set appropriately.
\subsubsection*{Errors}
\begin{itemize}[noitemsep]
\item \texttt{PICO$\_$ERR$\_$EINVAL} - invalid argument
\item \texttt{PICO$\_$ERR$\_$ENOMEM} - not enough space
\end{itemize}
\subsubsection*{Example}
\begin{verbatim}
PICO_DNS_SD_KV_VECTOR_DECLARE(dictionary);
pico_dns_sd_register_service("Printer 2nd Floor", "_printer._sub._http._tcp", 80, \\
&dictionary, 240, &reg_cb, NULL);
\end{verbatim}
\subsection{pico$\_$dns$\_$sd$\_$kv$\_$vector$\_$add}
\subsubsection*{Description}
Add a key-value pair the a key-value pair vector.
\subsubsection*{Function prototype}
\begin{verbatim}
int pico_dns_sd_kv_vector_add( kv_vector *vector, char *key, char *value );
\end{verbatim}
\subsubsection*{Parameters}
\begin{itemize}[noitemsep]
\item \texttt{vector} - Pointer to vector to add the pair to. Declare a key-value vector with the 'PICO$\_$DNS$\_$SD$\_$KV$\_$VECTOR$\_$DECLARE'-macro.
\item \texttt{key} - Key of the pair. Cannot be NULL.
\item \texttt{value} - Value of the pair. can be NULL, empty ("") or filled ("value").
\end{itemize}
\subsubsection*{Return value}
Returns 0 when the pair is added successfully, something else on failure. \texttt{pico$\_$err} is set appropriately.
\subsubsection*{Errors}
\begin{itemize}[noitemsep]
\item \texttt{PICO$\_$ERR$\_$EINVAL} - invalid argument
\item \texttt{PICO$\_$ERR$\_$ENOMEM} - not enough space
\end{itemize}
\subsubsection*{Example}
\begin{verbatim}
PICO_DNS_SD_KV_VECTOR_DECLARE(dictionary);
pico_dns_sd_kv_vector_add(&dictionary, "pass", "1234");
pico_dns_sd_kv_vector_add(&dictionary, "color", NULL);
\end{verbatim}
This diff is collapsed.
This diff is collapsed.
......@@ -78,7 +78,7 @@ void cb_udpecho(uint16_t ev, struct pico_socket *s)
do {
read = pico_socket_recvfrom(s, recvbuf, 1400, &peer, &port);
if (read > 0)
pico_socket_sendto(s, recvbuf, r, &peer, port);
pico_socket_sendto(s, recvbuf, read, &peer, port);
} while(read > 0);
}
......
......@@ -40,7 +40,8 @@ internal applets as well as generic POSIX-compliant socket interfaces.
described in the socket API documentation.
\item \textbf{DNS client} A small DNS client is provided to resolve an IP address for a given name.
The API supports setting several DNS servers and a small cache.
\item \textbf{MDNS client} Picotcp has a simple MDNS client for resolving names in IP adresses and vice versa.
\item \textbf{MDNS client} picoTCP has a mDNS responder on which records can be registered and resolved without the need of a centralised DNS-server. Supports possible caching of records and defending of hostnames.
\item \textbf{DNS-SD client} The stack can register services on the network via Multicast DNS, which allows Zero Configuration Networking capabilities.
\item \textbf{SNTP client} The stack supports synchronizing time over the network using sntp with a precision of at least 10msec. Similar to unix a gettimeofday function is implemented.
\item \textbf{DHCP client} A DHCP client can request an IP lease from a DHCP server to set the IP
adress of the device.
......@@ -176,10 +177,16 @@ DNS$\_$CLIENT&
This feature is required to resolve host names into IP addresses and vice-versa.
\\ \hline
MDNS$\_$CLIENT&
MDNS&
0,1&
1&
This feature is required to resolve host names into IP addresses and vice-versa without needing a centralised DNS server.
If enabled, registering and resolving DNS records on the network via Multicast DNS is possible.
\\ \hline
DNS$\_$SD&
0,1&
1&
If enabled, it is possible to register services on the network via Multicast DNS.
\\ \hline
SNTP$\_$CLIENT&
......
......@@ -67,6 +67,12 @@ Path MTU Discovery (\textsuperscript{1})\\ \hline
RFC 1323 &
TCP Extensions for High Performance \\ \hline
RFC 1332 &
The PPP Internet Protocol Control Protocol (IPCP) \\ \hline
RFC 1334 &
PPP Authentication Protocols \\ \hline
RFC 1337 &
TIME-WAIT Assassination Hazards in TCP \\ \hline
......@@ -79,6 +85,12 @@ Interoperation Between DHCP and BOOTP \\ \hline
RFC 1542 &
Clarifications and Extensions for the Bootstrap Protocol \\ \hline
RFC 1661 &
The Point-to-Point Protocol (PPP) \\ \hline
RFC 1662 &
PPP in HDLC-like Framing \\ \hline
RFC 1812 &
Requirements for IP Version 4 Routers \\ \hline
......@@ -88,6 +100,9 @@ Variable Length Subnet Table For IPv4 \\ \hline
RFC 1886 &
DNS Extensions to Support IP Version 6 (\textsuperscript{1}) \\ \hline
RFC 1994 &
PPP Challenge Handshake Authentication Protocol (CHAP) \\ \hline
RFC 2018 &
TCP Selective Acknowledgment Options \\ \hline
......@@ -154,6 +169,12 @@ IPv6 Stateless Address Autoconfiguration \\ \hline
RFC 6691 &
TCP Options and Maximum Segment Size (MSS) \\ \hline
RFC 6762 &
Multicast DNS \\ \hline
RFC 6763 &
DNS-based Service Discovery \\ \hline
\end{longtable}
(\textsuperscript{1}) Work in progress
......
......@@ -92,11 +92,13 @@ The following sections will describe the API for picoTCP.
\input{chap_api_dhcp_d}
\input{chap_api_dns_c}
\input{chap_api_mdns}
\input{chap_api_dns_sd}
\input{chap_api_sntp_c}
\input{chap_api_igmp}
\input{chap_api_ipfilter}
\input{chap_api_slaacv4}
\input{chap_api_tftp}
\input{chap_api_ppp}
\input{chap_api_olsr}
\input{chap_api_aodv}
......
......@@ -17,6 +17,10 @@ extern volatile unsigned int pico_ms_tick;
#define dbg(...)
#ifdef PICO_SUPPORT_PTHREAD
#define PICO_SUPPORT_MUTEX
#endif
#ifdef PICO_SUPPORT_RTOS
#define PICO_SUPPORT_MUTEX
......@@ -78,12 +82,12 @@ static inline void *pico_zalloc(size_t size)
static inline pico_time PICO_TIME_MS(void)
{
return pico_ms_tick;
return (pico_time)pico_ms_tick;
}
static inline pico_time PICO_TIME(void)
{
return PICO_TIME_MS() / 1000;
return (pico_time)(PICO_TIME_MS() / 1000);
}
static inline void PICO_IDLE(void)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*********************************************************************
PicoTCP. Copyright (c) 2012-2015 Altran Intelligent Systems. Some rights reserved.
PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved.
See LICENSE and COPYING for usage.
.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
MOD_OBJ+=$(LIBBASE)modules/pico_dev_pcap.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment