Policies.c

Go to the documentation of this file.
00001 
00002 #include <string.h>
00003 #include "Policies.h"
00004 #include "../constants.h"
00005 
00006 /// This functions returns the writePolicy given its name
00007 writePolicy_t getWritePolicyByName(const char *name){
00008         if              (strncasecmp(name, "random", MAX_PLNAME_LENGTH)==0)
00009                 return RANDOM;
00010         else if (       (strncasecmp(name, "ls", MAX_PLNAME_LENGTH)==0)||
00011                         (strncasecmp(name, "labeled_stream", MAX_PLNAME_LENGTH)==0))
00012                 return LABELED_STREAM;
00013         else if (       (strncasecmp(name, "mls", MAX_PLNAME_LENGTH)==0)||
00014                         (strncasecmp(name, "multicast_labeled_stream", MAX_PLNAME_LENGTH)==0))
00015                 return MULTICAST_LABELED_STREAM;
00016         else if (       strncasecmp(name, "broadcast", MAX_PLNAME_LENGTH)==0)
00017                 return BROADCAST;
00018         else if (       (strncasecmp(name, "rr", MAX_PLNAME_LENGTH)==0) || 
00019                         (strncasecmp(name, "", MAX_PLNAME_LENGTH)==0) ||
00020                         (strncasecmp(name, "round_robin", MAX_PLNAME_LENGTH)==0))
00021                 return ROUND_ROBIN;
00022         else 
00023                 return W_POLICY_ERROR;
00024 
00025 }
00026 

Generated on Tue Jan 17 19:18:38 2006 for Void by  doxygen 1.4.6