static void send_packet( uint16_t destination_port, packet_in packet_in ) { openflow_actions *actions = create_actions(); append_action_output( actions, destination_port, UINT16_MAX ); struct ofp_match match; set_match_from_packet( &match, packet_in.in_port, 0, packet_in.data ); buffer *flow_mod = create_flow_mod( get_transaction_id(), match, get_cookie(), OFPFC_ADD, 60, 0, UINT16_MAX, UINT32_MAX, OFPP_NONE, OFPFF_SEND_FLOW_REM, actions ); send_openflow_message( packet_in.datapath_id, flow_mod ); free_buffer( flow_mod ); send_packet_out( packet_in, actions ); delete_actions( actions ); }
static void send_flow_mod_receiving_lldp( sw_entry *sw, uint16_t hard_timeout, uint16_t priority ) { struct ofp_match match; memset( &match, 0, sizeof( struct ofp_match ) ); if ( !options.lldp_over_ip ) { match.wildcards = OFPFW_ALL & ~OFPFW_DL_TYPE; match.dl_type = ETH_ETHTYPE_LLDP; } else { match.wildcards = OFPFW_ALL & ~( OFPFW_DL_TYPE | OFPFW_NW_PROTO | OFPFW_NW_SRC_MASK | OFPFW_NW_DST_MASK ); match.dl_type = ETH_ETHTYPE_IPV4; match.nw_proto = IPPROTO_ETHERIP; match.nw_src = options.lldp_ip_src; match.nw_dst = options.lldp_ip_dst; } openflow_actions *actions = create_actions(); const uint16_t max_len = UINT16_MAX; append_action_output( actions, OFPP_CONTROLLER, max_len ); const uint16_t idle_timeout = 0; const uint32_t buffer_id = UINT32_MAX; const uint16_t flags = 0; buffer *flow_mod = create_flow_mod( get_transaction_id(), match, get_cookie(), OFPFC_ADD, idle_timeout, hard_timeout, priority, buffer_id, OFPP_NONE, flags, actions ); send_openflow_message( sw->datapath_id, flow_mod ); delete_actions( actions ); free_buffer( flow_mod ); debug( "Sent a flow_mod for receiving LLDP frames from %#" PRIx64 ".", sw->datapath_id ); }
MainWindow::MainWindow(std::shared_ptr<ChartModel> chart_model) : menu_file(nullptr) , menu_view(nullptr) , menu_help(nullptr) , toolbar(nullptr) , action_exit(nullptr) , action_toggle_fullscreen(nullptr) , action_about(nullptr) , action_about_qt(nullptr) , action_zoom_in(nullptr) , action_zoom_out(nullptr) , map_widget(nullptr) , chart_model(chart_model) { setWindowTitle(tr("qtnavigator")); map_widget = new MapWidget(this); map_widget->set(chart_model); create_actions(); create_menus(); create_statusbar(); create_toolbar(); setCentralWidget(map_widget); }
bool send_lldp( probe_timer_entry *port ) { buffer *lldp; lldp = create_lldp_frame( port->mac, port->datapath_id, port->port_no ); openflow_actions *actions = create_actions(); if ( !append_action_output( actions, port->port_no, UINT16_MAX ) ) { free_buffer( lldp ); error( "Failed to sent LLDP frame(%#" PRIx64 ", %u)", port->datapath_id, port->port_no ); return false; } uint32_t transaction_id = get_transaction_id(); buffer *packetout = create_packet_out( transaction_id, UINT32_MAX, OFPP_NONE, actions, lldp ); if ( !send_openflow_message( port->datapath_id, packetout ) ) { free_buffer( lldp ); free_buffer( packetout ); delete_actions( actions ); die( "send_openflow_message" ); } free_buffer( lldp ); free_buffer( packetout ); delete_actions( actions ); debug( "Sent LLDP frame(%#" PRIx64 ", %u)", port->datapath_id, port->port_no ); return true; }
Plot_xyz::Plot_xyz() { i = 0; setWindowTitle(tr("The distribution of transfered electrons")); create_widgets(); widgets_setting(); create_actions(); }
static void handle_packet_in( uint64_t datapath_id, packet_in message ) { openflow_actions *actions = create_actions(); append_action_output( actions, ( uint16_t ) ( message.in_port + 1 ), OFPCML_NO_BUFFER ); struct ofp_match match; set_match_from_packet( &match, message.in_port, 0, message.data ); buffer *flow_mod = create_flow_mod( get_transaction_id(), match, get_cookie(), OFPFC_ADD, 0, 0, OFP_HIGH_PRIORITY, message.buffer_id, OFPP_NONE, 0, actions ); send_openflow_message( datapath_id, flow_mod ); free_buffer( flow_mod ); delete_actions( actions ); }
static void handle_switch_ready( uint64_t datapath_id, void *user_data ) { UNUSED( user_data ); openflow_actions *actions = create_actions(); append_action_output( actions, OFPP_CONTROLLER, OFPCML_NO_BUFFER ); openflow_instructions *insts = create_instructions(); append_instructions_apply_actions( insts, actions ); buffer *flow_mod = create_flow_mod( get_transaction_id(), get_cookie(), 0, 0, OFPFC_ADD, 0, 0, OFP_LOW_PRIORITY, OFP_NO_BUFFER, 0, 0, OFPFF_SEND_FLOW_REM, NULL, insts ); send_openflow_message( datapath_id, flow_mod ); free_buffer( flow_mod ); delete_instructions( insts ); delete_actions( actions ); }
static void do_flooding( packet_in packet_in ) { openflow_actions *actions = create_actions(); append_action_output( actions, OFPP_FLOOD, UINT16_MAX ); buffer *packet_out; if ( packet_in.buffer_id == UINT32_MAX ) { buffer *frame = duplicate_buffer( packet_in.data ); fill_ether_padding( frame ); packet_out = create_packet_out( get_transaction_id(), packet_in.buffer_id, packet_in.in_port, actions, frame ); free_buffer( frame ); } else { packet_out = create_packet_out( get_transaction_id(), packet_in.buffer_id, packet_in.in_port, actions, NULL ); } send_openflow_message( packet_in.datapath_id, packet_out ); free_buffer( packet_out ); delete_actions( actions ); }
html_editor::html_editor(QWidget* parent): QWebView(parent) { create_actions(); connect(this, SIGNAL(loadFinished(bool)), SLOT(load_finished(bool))); page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); connect(this, SIGNAL(linkClicked(const QUrl&)), SLOT(link_clicked(const QUrl&))); }
static void do_flooding( packet_in packet_in, uint32_t in_port ) { openflow_actions *actions = create_actions(); append_action_output( actions, OFPP_ALL, OFPCML_NO_BUFFER ); buffer *packet_out; if ( packet_in.buffer_id == OFP_NO_BUFFER ) { buffer *frame = duplicate_buffer( packet_in.data ); fill_ether_padding( frame ); packet_out = create_packet_out( get_transaction_id(), packet_in.buffer_id, in_port, actions, frame ); free_buffer( frame ); } else { packet_out = create_packet_out( get_transaction_id(), packet_in.buffer_id, in_port, actions, NULL ); } send_openflow_message( packet_in.datapath_id, packet_out ); free_buffer( packet_out ); delete_actions( actions ); }
openflow_actions * pack_basic_action( VALUE r_action ) { openflow_actions *actions = create_actions(); VALUE r_action_ins = Qnil; VALUE r_id = rb_intern( "pack_basic_action" ); if ( !NIL_P( r_action ) ) { switch ( TYPE( r_action ) ) { case T_ARRAY: { VALUE *each = RARRAY_PTR( r_action ); for ( int i = 0; i < RARRAY_LEN( r_action ); i++ ) { if ( rb_respond_to( each[ i ], r_id ) ) { r_action_ins = Data_Wrap_Struct( rb_obj_class( each[ i ] ), NULL, NULL, actions ); rb_funcall( each[ i ], r_id, 1, r_action_ins ); } } } break; case T_OBJECT: if ( rb_respond_to( r_action, r_id ) ) { r_action_ins = Data_Wrap_Struct( rb_obj_class( r_action ), NULL, NULL, actions ); rb_funcall( r_action, r_id, 1, r_action_ins ); } break; default: rb_raise( rb_eTypeError, "Action argument must be either an Array or an Action object" ); break; } } Data_Get_Struct( r_action_ins, openflow_actions, actions ); return actions; }
MainWindow::MainWindow(QWidget *parent) : QDialog(parent) { create_buttons(); create_tabs(); create_layout(); create_actions(); chosen_file = ""; }
static void output_packet( const buffer *packet, uint64_t dpid, uint16_t port_no ) { openflow_actions *actions = create_actions(); append_action_output( actions, port_no, UINT16_MAX ); send_packet_out( dpid, actions, packet ); delete_actions( actions ); }
static void handle_packet_in( uint64_t datapath_id, packet_in message ) { if ( message.data == NULL ) { error( "data must not be NULL" ); return; } uint32_t in_port = get_in_port_from_oxm_matches( message.match ); if ( in_port == 0 ) { return; } openflow_actions *actions = create_actions(); append_action_output( actions, OFPP_ALL, OFPCML_NO_BUFFER ); openflow_instructions *insts = create_instructions(); append_instructions_apply_actions( insts, actions ); oxm_matches *match = create_oxm_matches(); set_match_from_packet( match, in_port, 0, message.data ); buffer *flow_mod = create_flow_mod( get_transaction_id(), get_cookie(), 0, 0, OFPFC_ADD, 60, 0, OFP_HIGH_PRIORITY, message.buffer_id, 0, 0, OFPFF_SEND_FLOW_REM, match, insts ); send_openflow_message( datapath_id, flow_mod ); free_buffer( flow_mod ); delete_oxm_matches( match ); delete_instructions( insts ); if ( message.buffer_id == OFP_NO_BUFFER ) { buffer *frame = duplicate_buffer( message.data ); fill_ether_padding( frame ); buffer *packet_out = create_packet_out( get_transaction_id(), message.buffer_id, in_port, actions, frame ); send_openflow_message( datapath_id, packet_out ); free_buffer( packet_out ); free_buffer( frame ); } delete_actions( actions ); }
static void do_flooding( packet_in packet_in ) { openflow_actions *actions = create_actions(); append_action_output( actions, OFPP_FLOOD, UINT16_MAX ); send_packet_out( packet_in, actions ); delete_actions( actions ); }
static void send_packet_out_for_each_switch( switch_info *sw, const buffer *packet, uint64_t dpid, uint16_t in_port ) { openflow_actions *actions = create_actions(); int number_of_actions = foreach_port( sw->ports, build_packet_out_actions, actions, dpid, in_port ); if ( number_of_actions > 0 ) { send_packet_out( sw->dpid, actions, packet ); } delete_actions( actions ); }
SettingMainWindow::SettingMainWindow() { xbel_tree_ = new XbelTree; setCentralWidget(xbel_tree_); create_actions(); create_menu(); statusBar()->showMessage(tr("Ready")); setWindowTitle(tr("DOM Bookmarks")); resize(480, 320); }
static void gdm_ovirtcred_extension_init (GdmOVirtCredExtension *extension) { extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension, GDM_TYPE_OVIRTCRED_EXTENSION, GdmOVirtCredExtensionPrivate); extension->priv->icon = g_themed_icon_new ("gdm-ovirtcred"); create_page (extension); create_actions (extension); gdm_ovirtcred_extension_reset (GDM_CONVERSATION (extension)); }
Astro_MainWindow::Astro_MainWindow() { // resize our window on start-up this->resize( 800, 600 ); mdi_area = new Astro_MdiArea( this ); setCentralWidget( mdi_area ); create_actions(); create_menus(); create_toolbars(); create_statusbar(); }
Main_GUI::Main_GUI(int range_min, int range_max, int limit, bool gray, bool gdi, bool dw, int increase, const char* exceptions, bool ignore, bool wincomp, bool pre, bool components, bool no, int fallback, bool symb) : hinting_range_min(range_min), hinting_range_max(range_max), hinting_limit(limit), gray_strong_stem_width(gray), gdi_cleartype_strong_stem_width(gdi), dw_cleartype_strong_stem_width(dw), increase_x_height(increase), x_height_snapping_exceptions_string(exceptions), ignore_restrictions(ignore), windows_compatibility(wincomp), pre_hinting(pre), hint_with_components(components), no_info(no), latin_fallback(fallback), symbol(symb) { x_height_snapping_exceptions = NULL; create_layout(); create_connections(); create_actions(); create_menus(); create_status_bar(); set_defaults(); read_settings(); setUnifiedTitleAndToolBarOnMac(true); // XXX register translations somewhere and loop over them if (QLocale::system().name() == "en_US") locale = new QLocale; else locale = new QLocale(QLocale::C); }
static void send_packet( uint32_t destination_port, packet_in packet_in, uint32_t in_port ) { openflow_actions *actions = create_actions(); append_action_output( actions, destination_port, OFPCML_NO_BUFFER ); openflow_instructions *insts = create_instructions(); append_instructions_apply_actions( insts, actions ); oxm_matches *match = create_oxm_matches(); set_match_from_packet( match, in_port, NULL, packet_in.data ); buffer *flow_mod = create_flow_mod( get_transaction_id(), get_cookie(), 0, 0, OFPFC_ADD, 60, 0, OFP_HIGH_PRIORITY, packet_in.buffer_id, 0, 0, OFPFF_SEND_FLOW_REM, match, insts ); send_openflow_message( packet_in.datapath_id, flow_mod ); free_buffer( flow_mod ); delete_oxm_matches( match ); delete_instructions( insts ); if ( packet_in.buffer_id == OFP_NO_BUFFER ) { buffer *frame = duplicate_buffer( packet_in.data ); fill_ether_padding( frame ); buffer *packet_out = create_packet_out( get_transaction_id(), packet_in.buffer_id, in_port, actions, frame ); send_openflow_message( packet_in.datapath_id, packet_out ); free_buffer( packet_out ); free_buffer( frame ); } delete_actions( actions ); }
static openflow_actions * create_openflow_actions_to_update_vid( uint16_t in_vid, uint16_t out_vid ) { if ( in_vid == out_vid ) { return NULL; } openflow_actions *vlan_actions = create_actions(); if ( out_vid == VLAN_NONE ) { append_action_strip_vlan( vlan_actions ); } else { append_action_set_vlan_vid( vlan_actions, out_vid ); } return vlan_actions; }
static void gdm_password_extension_init (GdmPasswordExtension *extension) { extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension, GDM_TYPE_PASSWORD_EXTENSION, GdmPasswordExtensionPrivate); extension->priv->icon = g_themed_icon_new ("dialog-password"); create_page (extension); create_actions (extension); extension->priv->message_queue = g_queue_new (); gdm_password_extension_reset (GDM_LOGIN_EXTENSION (extension)); }
static void send_packet_out_for_each_switch( switch_info *sw, void *user_data ) { openflow_actions *actions = create_actions(); port_params params; params.switch_params = user_data; params.actions = actions; foreach_port( sw->ports, build_packet_out_actions, ¶ms ); // check if no action is build if ( actions->n_actions > 0 ) { const buffer *packet = params.switch_params->packet; send_packet_out( sw->dpid, actions, packet ); } delete_actions( actions ); }
MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent) { gl_format = QGLFormat::defaultFormat(); gl_format.setSampleBuffers(true); gl_format.setSamples(4); shared_gl = new QGLWidget(gl_format, this); mdi = new QMdiArea(this); mdi->setViewMode(QMdiArea::TabbedView); mdi->setTabsClosable(true); mdi->setTabsMovable(true); setCentralWidget(mdi); connect(mdi, SIGNAL(subWindowActivated(QMdiSubWindow*)), SLOT(on_window_change(QMdiSubWindow*))); create_actions(); create_menus(); QToolBar * tool = new QToolBar("Tools", this); tool_group = new QActionGroup(this); tool->addAction(create_tool_icon("Pointer", "editor/pointer_tool.png", tool_group, POINTER_EDIT_TOOL)); tool->addAction(create_tool_icon("Block", "editor/block_tool.png", tool_group, BLOCK_EDIT_TOOL)); tool->addAction(create_tool_icon("Pencil", "editor/pencil_tool.png", tool_group, PENCIL_EDIT_TOOL)); tool->addAction(create_tool_icon("Bucket", "editor/bucket_tool.png", tool_group, BUCKET_EDIT_TOOL)); addToolBar(Qt::LeftToolBarArea, tool); model_dock = new QDockWidget("Model"); model_properties = new ModelProperties(this); model_dock->setWidget(model_properties); addDockWidget(Qt::RightDockWidgetArea, model_dock); palette_dock = new QDockWidget("Palette"); palette_editor = new PaletteEditor(this); palette_dock->setWidget(palette_editor); addDockWidget(Qt::RightDockWidgetArea, palette_dock); on_window_change(0); set_status("Ready..."); }
static void gdm_smartcard_extension_init (GdmSmartcardExtension *extension) { extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension, GDM_TYPE_SMARTCARD_EXTENSION, GdmSmartcardExtensionPrivate); extension->priv->icon = g_themed_icon_new ("gdm-smartcard"); create_page (extension); create_actions (extension); extension->priv->message_queue = g_queue_new (); extension->priv->settings = g_settings_new ("org.gnome.login-screen"); gdm_smartcard_extension_reset (GDM_LOGIN_EXTENSION (extension)); }
static void gdm_fingerprint_extension_init (GdmFingerprintExtension *extension) { extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension, GDM_TYPE_FINGERPRINT_EXTENSION, GdmFingerprintExtensionPrivate); extension->priv->icon = g_themed_icon_new ("gdm-fingerprint"); create_page (extension); create_actions (extension); extension->priv->message_queue = g_queue_new (); extension->priv->settings = g_settings_new ("org.gnome.login-screen"); extension->priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL); gdm_fingerprint_extension_reset (GDM_LOGIN_EXTENSION (extension)); }
MainWindow::MainWindow(bool success, QSqlDatabase db) { is_connect = success; base = db; settings = new QSettings("erk", "DocsPrint"); docs_list = 0; doc = 0; preview = 0; mwidget = 0; // если соединение с базой было успешным, создаём центральный виджет (таблицу с документами). // Иначе экран будет пустым, пока не соединимся с базой if(is_connect) create_central_widget(); // создаём и оживляем меню create_actions(); create_menu(); }
static void output_packet( buffer *packet, uint64_t dpid, uint16_t port_no ) { openflow_actions *actions = create_actions(); const uint16_t max_len = UINT16_MAX; append_action_output( actions, port_no, max_len ); const uint32_t transaction_id = get_transaction_id(); const uint32_t buffer_id = UINT32_MAX; const uint16_t in_port = OFPP_NONE; fill_ether_padding( packet ); buffer *packet_out = create_packet_out( transaction_id, buffer_id, in_port, actions, packet ); send_openflow_message( dpid, packet_out ); free_buffer( packet_out ); delete_actions( actions ); }
static void send_packet_out( uint64_t datapath_id, packet_in *message, uint16_t out_port ) { uint32_t buffer_id = message->buffer_id; uint16_t in_port = message->in_port; if ( datapath_id != message->datapath_id ) { buffer_id = UINT32_MAX; in_port = OFPP_NONE; } openflow_actions *actions = create_actions(); append_action_output( actions, out_port, UINT16_MAX ); const buffer *data = NULL; if ( buffer_id == UINT32_MAX ) { data = message->data; } buffer *packet_out = create_packet_out( get_transaction_id(), buffer_id, in_port, actions, data ); delete_actions( actions ); send_openflow_message( datapath_id, packet_out ); free_buffer( packet_out ); }