BEEP Core protocol central
Project BHはクライアント・サーバ型システムとして作る予定なので,プロトコルをどうしようかあれこれ考えていたのだが,BEEPというものを発見したので使ってみようと思う。
BEEPは,Block Extensible Exchange Protocolの略。Peer-to-peer通信の下回りを面倒みてくれるようだ。
Cでの実装に,Vortex Libraryがある。中を見たところ,結局はアプリケーションレイヤーは自分で設計して作らなければならなさそうだ。当たり前といえば当たり前。ぱっと思いつくのは,ログイン処理や自機の移動など。自機近傍に他機が近づいた時も,通信が必要だろう。
Voltex Libraryをビルドしてみた。Axl Libraryが必要なので先にビルド。特に問題なし。python-devが必要なので,apt-get install。makeすると,
cc1: warnings being treated as errors
vortex_tls.c: In function ‘vortex_tls_invoke_tls_activation’:
vortex_tls.c:617: error: assignment discards qualifiers from pointer target type
vortex_tls.c: In function ‘vortex_tls_prepare_listener’:
vortex_tls.c:1377: error: assignment discards qualifiers from pointer target type
とエラー発生。仕方ないのでBH用のリモートブランチを作成して修正する。
--- a/tls/vortex_tls.c
+++ b/tls/vortex_tls.c
@@ -586,7 +586,7 @@ int vortex_tls_invoke_tls_activation (VortexConnection * connection)
/* get current context */
VortexCtx * ctx = vortex_connection_get_ctx (connection);
SSL_CTX * ssl_ctx;
- SSL_METHOD * meth;
+ const SSL_METHOD * meth;
SSL * ssl;
X509 * server_cert;
VortexTlsCtxCreation ctx_creation;
@@ -1344,7 +1344,7 @@ void vortex_tls_prepare_listener (VortexConnection * connection)
{
/* get current context */
VortexCtx * ctx = vortex_connection_get_ctx (connection);
- SSL_METHOD * meth;
+ const SSL_METHOD * meth;
SSL_CTX * ssl_ctx;
SSL * ssl;
char * certificate_file;
const修飾が足りないので追加。コンパイルエラーはとれた。ドキュメントの生成でエラーが出るがよく分からないのでmake install。とりあえず作業終了。