Example #1
0
/*
 * Disable protocols as per the stored configuration
 */
void
set_disabled_protos_list(void)
{
  gint i;
  GList *fl_ent;
  protocol_def *prot;

  /*
   * assume all protocols are enabled by default
   */
  if (disabled_protos == NULL)
    goto skip;

  fl_ent = g_list_first(disabled_protos);

  while (fl_ent != NULL) {
    prot = (protocol_def *) fl_ent->data;
    i = proto_get_id_by_filter_name(prot->name);
    if (i == -1) {
      /* XXX - complain here? */
    } else {
      if (proto_can_toggle_protocol(i))
	proto_set_decoding(i, FALSE);
    }

    fl_ent = fl_ent->next;
  }

skip:
  if (global_disabled_protos == NULL)
    return;

  fl_ent = g_list_first(global_disabled_protos);

  while (fl_ent != NULL) {
    prot = (protocol_def *) fl_ent->data;
    i = proto_get_id_by_filter_name(prot->name);
    if (i == -1) {
      /* XXX - complain here? */
    } else {
      if (proto_can_toggle_protocol(i)) {
	proto_set_decoding(i, FALSE);
	proto_set_cant_toggle(i);
      }
    }

    fl_ent = fl_ent->next;
  }
}
void
proto_disable_proto_by_name(const char *name)
{
    protocol_t *protocol;
    int proto_id;

    proto_id = proto_get_id_by_filter_name(name);
    if (proto_id >= 0 ) {
        protocol = find_protocol_by_id(proto_id);
        if (proto_is_protocol_enabled(protocol) == TRUE) {
            if (proto_can_toggle_protocol(proto_id) == TRUE) {
                proto_set_decoding(proto_id, FALSE);
            }
        }
    }
}
 virtual void applyValuePrivate(gboolean value)
 {
     proto_set_decoding(proto_get_id(protocol_), value);
 }