srtp: basic implementation based on libsrtp2
[vpp.git] / src / plugins / srtp / srtp_plugin.md
1 # SRTP (Secure Real-time Transport Protocol) {#srtp_doc}
2
3 libsrtp2 based SRTP transport protocol implementation.
4
5 ## Maturity level
6 Experimental
7
8 ## Quickstart
9
10 1. Install libsrtp2-dev. On debian based OS:
11
12 ```
13 sudo apt get install libsrtp2-dev
14 ```
15
16 2. Build vpp
17
18 ```
19 make build
20 ```
21
22 3. Test protocol using vcl test server and client. On server side, start vpp and server app:
23
24 ```
25 export VT_PATH=$WS/build-root/build-vpp_debug-native/vpp/bin
26 $VT_PATH/vcl_test_server 1234 -p srtp
27 ```
28
29 On client side:
30
31 ```
32 export VT_PATH=$WS/build-root/build-vpp_debug-native/vpp/bin
33 $VT_PATH/vcl_test_client <server-ip> 1234 -U -X -S -N 10000 -T 128 -p srtp
34 ```
35
36 ## Custom libsrtp2 build
37
38 1. Create `build/external/packages/srtp.mk` with following example contents:
39
40 ```
41 srtp_version := 2.3.0
42 srtp_tarball := srtp_$(srtp_version).tar.gz
43 srtp_tarball_md5sum := da38ee5d9c31be212a12964c22d7f795
44 srtp_tarball_strip_dirs := 1
45 srtp_url := https://github.com/cisco/libsrtp/archive/v$(srtp_version).tar.gz
46
47 define  srtp_build_cmds
48         @cd $(srtp_build_dir) && \
49                 $(CMAKE) -DCMAKE_INSTALL_PREFIX:PATH=$(srtp_install_dir)        \
50                 -DCMAKE_C_FLAGS='-fPIC -fvisibility=hidden'  $(srtp_src_dir) > $(srtp_build_log)
51         @$(MAKE) $(MAKE_ARGS) -C $(srtp_build_dir) > $(srtp_build_log)
52 endef
53
54 define  srtp_config_cmds
55         @true
56 endef
57
58 define  srtp_install_cmds
59         @$(MAKE) $(MAKE_ARGS) -C $(srtp_build_dir) install > $(srtp_install_log)
60 endef
61
62
63 $(eval $(call package,srtp))
64 ```
65
66 2. Include `srtp.mk` in `build/external/Makefile` and add to install target.
67
68 3. Rebuild external dependencies:
69
70 ```
71 make install-ext-deps
72 ```