Esempio n. 1
0
int main(int argc, char *argv[]) {

	programName = "firechain";
	c7c88e52_ensureUserIsRoot();

	if (argc == 1) {
		c7c88e52_printUsage(USAGE_MSG);
		exit(EXIT_FAILURE);
	} else if (f6215943_isEqual("help", argv[1])) {
		printHelp(argc, argv);
		exit(EXIT_SUCCESS);
	}

	FirewallParams firewallParams;
	CmdLineParam cmdLineParm;

	d7ad7024_initCmdLineParam(&cmdLineParm, argc, argv, USAGE_MSG);
	processCmdLine(&cmdLineParm, &firewallParams);

	if (firewallParams.action == ADD) {
		processAdd(&firewallParams);
	} else if (firewallParams.action == DELETE) {
		processDelete(&firewallParams);
	} else if (firewallParams.action == VIEW) {
		for (int i=0; i < firewallParams.ruleList.length; i++) {
			puts(firewallParams.ruleList.values[i]);
		}
	}

	b196167f_destroyAllElements(&firewallParams.ruleList);

	// Exit with success
	exit(EXIT_SUCCESS);
}
NodeFileSource::NodeFileSource() :
    queue(new Queue(uv_default_loop(), [this](Action &action) {
        if (action.type == Action::Add) {
            processAdd(action.request);
        } else if (action.type == Action::Cancel) {
            processCancel(action.request);
        }
    }))
{
    // Make sure that the queue doesn't block the loop from exiting.
    queue->unref();
}
Esempio n. 3
0
void MarkerVisualizer::processMessage( const std_msgs::VisualizationMarker& message )
{
  switch ( message.action )
  {
  case MarkerActions::Add:
    processAdd( message );
    break;

  case MarkerActions::Modify:
    processModify( message );
    break;

  case MarkerActions::Delete:
    processDelete( message );
    break;

  default:
    printf( "Unknown marker action: %d\n", message.action );
  }
}
void ShapeDisplay::processMessage( const cob_3d_mapping_msgs::Shape::ConstPtr& message )
{
  /*if (!validateFloats(*message))
  {
    setMarkerStatus(MarkerID(message->ns, message->id), status_levels::Error, "Contains invalid floating point values (nans or infs)");
    return;
  }

  switch ( message->action )
  {
  case cob_3d_mapping_msgs::Shape::ADD:*/
    processAdd( message );
    /*break;

  case cob_3d_mapping_msgs::Shape::DELETE:
    processDelete( message );
    break;

  default:
    ROS_ERROR( "Unknown marker action: %d\n", message->action );
  }*/
}
Esempio n. 5
0
void MarkerDisplay::processMessage( const visualization_msgs::Marker::ConstPtr& message )
{
  if (!validateFloats(*message))
  {
    setMarkerStatus(MarkerID(message->ns, message->id), StatusProperty::Error, "Contains invalid floating point values (nans or infs)");
    return;
  }

  switch ( message->action )
  {
  case visualization_msgs::Marker::ADD:
    processAdd( message );
    break;

  case visualization_msgs::Marker::DELETE:
    processDelete( message );
    break;

  default:
    ROS_ERROR( "Unknown marker action: %d\n", message->action );
  }
}