summaryrefslogtreecommitdiff
path: root/p11p-daemon/src/p11p_rpc.hrl
blob: c511e205cb8c5b6bd1559830660dfb297066df0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
%%% Copyright (c) 2019, Sunet.
%%% See LICENSE for licensing information.

%% The only RPC version we support.
-define(RPC_VERSION, 0).

-record(p11rpc_msg, {
	  call_code = -1 :: integer(),		% Length is 4
	  opt_len = -1 :: integer(),		% Length is 4
	  data_len = -1 :: integer(),		% Length is 4

	  options = <<>> :: binary(),	    % Length is header.opt_len
	  data = <<>> :: binary(),	    % Length is header.buf_len

	  buffer = <<>> :: binary(),
	  state = header :: header | opts | data | done
	 }).
-type p11rpc_msg() :: #p11rpc_msg{}.