ns-allinone-2.35/kmanet/protocol.cc
int
KMANET::command(int argc, const char*const* argv) {
	printf("%s %s %d\n",__func__,__FILE__,__LINE__);
	if (argc == 2) {
		// Starts all timers
		if (strcasecmp(argv[1], "start") == 0) {
			
			return TCL_OK;
    		}
	}
	else if (argc == 3) {
		// Obtains the corresponding dmux to carry packets to upper layers
		if (strcmp(argv[1], "port-dmux") == 0) {
    			dmux_ = (PortClassifier*)TclObject::lookup(argv[2]);
			if (dmux_ == NULL) {
				fprintf(stderr, "%s: %s lookup of %s failed\n", __FILE__, argv[1], argv[2]);
				return TCL_ERROR;
			}
			return TCL_OK;
    		}
		// Obtains the corresponding tracer
		else if (strcmp(argv[1], "log-target") == 0 || strcmp(argv[1], "tracetarget") == 0) {
			logtarget_ = (Trace*)TclObject::lookup(argv[2]);
			if (logtarget_ == NULL)
				return TCL_ERROR;
			return TCL_OK;
		}
	}  

	// Pass the command up to the base class
	return Agent::command(argc, argv); 
}
///
/// \brief Interface with TCL interpreter.
///
/// From your TCL scripts or shell you can invoke commands on this KMANET
/// routing agent thanks to this function. Currently you can call "start",
/// "print_rtable", "print_linkset", "print_nbset", "print_nb2hopset",
/// "print_mprset", "print_mprselset" and "print_topologyset" commands.
///
/// \param argc Number of arguments.
/// \param argv Arguments.
/// \return TCL_OK or TCL_ERROR.
///
\brief Interface with TCL interpreter.
From your TCL scripts or shell you can invoke commands on this KMANET
routing agent thanks to this function.

\param argc Number of arguments.
\param argv Arguments.
\ brief Interface with TCL interpreter . From your TCL scripts or shell you can invoke commands on this KMANET routing agent thanks to this function . \ param argc Number of arguments . \ param argv Arguments .
int
KMANET::command(int argc, const char*const* argv) {
	printf("%s %s %d\n",__func__,__FILE__,__LINE__);
	if (argc == 2) {
		if (strcasecmp(argv[1], "start") == 0) {
			return TCL_OK;
    		}
	}
	else if (argc == 3) {
		if (strcmp(argv[1], "port-dmux") == 0) {
    			dmux_ = (PortClassifier*)TclObject::lookup(argv[2]);
			if (dmux_ == NULL) {
				fprintf(stderr, "%s: %s lookup of %s failed\n", __FILE__, argv[1], argv[2]);
				return TCL_ERROR;
			}
			return TCL_OK;
    		}
		else if (strcmp(argv[1], "log-target") == 0 || strcmp(argv[1], "tracetarget") == 0) {
			logtarget_ = (Trace*)TclObject::lookup(argv[2]);
			if (logtarget_ == NULL)
				return TCL_ERROR;
			return TCL_OK;
		}
	}  
	return Agent::command(argc, argv); 
}
int KMANET :: command ( int argc , const char * const * argv ) { printf ( " \n " , __func__ , __FILE__ , __LINE__ ) ; if ( argc == 2 ) { if ( strcasecmp ( argv [ 1 ] , " " ) == 0 ) { return TCL_OK ; } } else if ( argc == 3 ) { if ( strcmp ( argv [ 1 ] , " " ) == 0 ) { dmux_ = ( PortClassifier * ) TclObject :: lookup ( argv [ 2 ] ) ; if ( dmux_ == NULL ) { fprintf ( stderr , " \n " , __FILE__ , argv [ 1 ] , argv [ 2 ] ) ; return TCL_ERROR ; } return TCL_OK ; } else if ( strcmp ( argv [ 1 ] , " " ) == 0 || strcmp ( argv [ 1 ] , " " ) == 0 ) { logtarget_ = ( Trace * ) TclObject :: lookup ( argv [ 2 ] ) ; if ( logtarget_ == NULL ) return TCL_ERROR ; return TCL_OK ; } } return Agent :: command ( argc , argv ) ; }
\brief Interface with TCL interpreter.
\ brief Interface with TCL interpreter .
// Starts all timers // Obtains the corresponding dmux to carry packets to upper layers // Obtains the corresponding tracer // Pass the command up to the base class