Main Page | Class List | File List | Class Members | File Members

protocol.h File Reference

Provides a shared method definition for plugins and the daemon to use for all communication. More...

#include "transfer_api.h"
#include "if_event_api.h"
#include "share_hash.h"
#include "protocol_ver.h"

Go to the source code of this file.

Classes

struct  protocol

giFT Assigned Methods

Communication methods defined by giFT before protocol's initialization. No protocol should override these, however, most protocols will want to call at least some of these throughout the course of their protocol's lifespan.

#define FILE_LINE_FUNC   __FILE__,__LINE__,__PRETTY_FUNCTION__
#define DBGFN   dbg
#define DBGSOCK   dbgsock
#define HASH_PRIMARY   0x01
#define HASH_SECONDARY   0x02
#define HASH_LOCAL   0x04 /* HASH_PRIMARY implicitly adds this */
#define SHARE_LOOKUP_HASH   (1) /**< By stored hash */
#define SHARE_LOOKUP_HPATH   (2) /**< By exclusion (hidden) path */
#define SHARE_LOOKUP_PATH   (3) /**< Full local path */
#define UPLOAD_AUTH_ALLOW   (0)
#define UPLOAD_AUTH_STALE   (-1)
#define UPLOAD_AUTH_MAX   (-2)
#define UPLOAD_AUTH_MAX_PERUSER   (-3)
#define UPLOAD_AUTH_NOTSHARED   (-4)
#define UPLOAD_AUTH_HIDDEN   (-5)

Defines

#define protocol_compat(p, dev_ver)   protocol_compat_ex(p,LIBGIFTPROTO_VERSION,dev_ver)

Typedefs

typedef protocol Protocol

Functions

LIBGIFTPROTO_EXPORT int protocol_compat_ex (Protocol *p, uint32_t link_ver, uint32_t dev_ver)


Detailed Description

Provides a shared method definition for plugins and the daemon to use for all communication.

The protocol structure unifies all the API that plugins will use to interact directly with the daemon for clarity and portability reasons.


Define Documentation

#define protocol_compat p,
dev_ver   )     protocol_compat_ex(p,LIBGIFTPROTO_VERSION,dev_ver)
 

Eased interface to maintain backwards compatibility and hide the link check.

#define SHARE_LOOKUP_HASH   (1) /**< By stored hash */
 

By stored hash

#define SHARE_LOOKUP_HPATH   (2) /**< By exclusion (hidden) path */
 

By exclusion (hidden) path

#define SHARE_LOOKUP_PATH   (3) /**< Full local path */
 

Full local path


Typedef Documentation

typedef struct protocol Protocol
 

Protocol structure containing methods for bidirectional communication between daemon and protocol plugin.


Function Documentation

LIBGIFTPROTO_EXPORT int protocol_compat_ex Protocol p,
uint32_t  link_ver,
uint32_t  dev_ver
 

Attempts to determine if the communication defined here (libgiftproto) is compatible with the current plugin or giftd binary. All protocol plugins are expected to call this first in Protocol::init and return FALSE from there if the runtime versions are not compatible.

Please note that you should specify the version that you know to be compatible. That is, the version that you were working from when developing, or the maximum possible compatible version that you know of. Please allow libgiftproto to determine compatibility beyond that point.

Parameters:
p 
link_ver Version known at compile time. Always pass ::LIBGIFTPROTO_VERSION.
dev_ver Last known compatible libgiftproto version known to the author. Use the macro ::LIBGIFTPROTO_MKVERSION.
Returns:
If the return value is less than, equal to, or greater than zero the version supplied is respectively too low, compatible, or too great for the current libgiftproto runtime.


Generated on Sun Aug 22 08:08:53 2004 by doxygen 1.3.7