diff --git a/src/client/libdistren.h b/src/client/libdistren.h --- a/src/client/libdistren.h +++ b/src/client/libdistren.h @@ -30,12 +30,33 @@ #include "common/options.h" #include "common/remoteio.h" +#include + +enum distren_state + { + /** + * client is waiting for a VERSION packet from the server. + */ + DISTREN_STATE_VERSION, + /** + * We are waiting to be authenticated. + */ + DISTREN_STATE_AUTH, + DISTREN_STATE_NORMAL, + DISTREN_STATE_UPLOADING, + }; + struct distren { struct options_common *options; char *server; - /* if rem is NULL, we're not connected to the server */ + enum distren_state state; + + /* + * If rem is NULL, we're not connected to the server. This is the + * way to detect a communication error. + */ struct remoteio *rem; /* * for libdistren_remoteio_read_handle(): determine whether or not @@ -43,8 +64,15 @@ struct distren */ short done_ad; + /* + * The servertype bitmask of the remote server. + */ + uint32_t servertype; + /* something on which to call multiio_poll() ;-) */ multiio_context_t multiio; + + }; struct distren_job