coTurn的附加程序命令行测试

turnadmin


看了代码以后发现turnadmin和turnserver其实是一个程序,代码中判断了第一个命令行参数是否”turnadmin”来区别。
trunadmin的入口为:mainrealy.c的adminmain函数

1) For the long-term credentials there must be keys
“turn/realm//user//key” and the values must be
the the hmackeys. For example, for the user “gorst”, realm “north.gov”
and password “hero”, there must be key “turn/realm/north.gov/user/gorst/key”
with value “7da2270ccfa49786e0115366d3a3d14d”.

以上turndb/schema.userdb.redis中的说明,对应以下命令行:

./turnadmin -k  -u gorst -p hero -r north.gov
返回:0x7da2270ccfa49786e0115366d3a3d14d

默认使用了md5加密,算法伪代码如下:

md5("gorst:north.gov:hero",32) = 0x7da2270ccfa49786e0115366d3a3d14d

注意:coTurn对传入的username,password,relam等都做了SASLprep函数检查。
SASLprep在ns_turn_msg.c中,只支持基本的ASCII字符串,所以如果以上参数包含中文的话会出错。

turnutils_peer


./turnutils_peer -v

开启一个peer,等待turnutils_uclient测试。
这个程序本身收到turnutils_uclient的包后自己不会打印回显任何数据。

turnutils_uclient


./turnutils_uclient -e 192.168.0.100 -r 3480 192.168.0.100

如果上面的peer程序没开启,返回的tot_recv_msgs和tot_recv_bytes会为0,Total lost packets为100%。

turnutils_natdiscovery和turnutils_stunclient


turnutils_natdiscovery的测试参数很多,具体也没搞清楚都是什么意思。

./turnutils_natdiscovery -m 192.168.0.100
./turnutils_stunclient 192.168.0.100

猜你喜欢

转载自blog.csdn.net/gamereborn/article/details/80211357
今日推荐