NAME

catdasp_handshake - DASP protocol handshake

SYNOPSIS

#include <cat/dasp.h>

int catdasp_handshake(cat_session *sess, catdasp_info *info, int fd_ids);

DESCRIPTION

This function performs a DASP negotiation in session sess on the descriptors specified by fd_ids.

The info strucure must have been created by a previous call to catdasp_new_info().

If fd_ids is specified as 0, server side protocols will use (CAT_CLENT_RFD | CAT_CLIENT_WFD) and client side protocols will use (CAT_SERVER_RFD | CAT_SERVER_WFD).

Once the protocol has been determined, the protocol handler for that protocol, as assigned by the catdasp_setprotocols() function, will be invoked.

RETURN VALUES

The function returns zero if successful, or a negative error code on error.

If the handshake was successful, the client side certificate can be retrieved with the catcert_getpeercert() function.

SEE ALSO

cat, catdasp

catcert_getpeercert, catdasp_setprotocols