Lines Matching defs:bridge

42 #include <net/bridge.h>
51 * bridges, and by the bridge daemon to retrieve configuration information.
54 #define BRIDGE_SVC_NAME "network/bridge"
63 /* Public bridge properties */
69 /* Private bridge properties */
367 char bridge[MAXLINKNAMELEN];
370 status = dladm_bridge_getlink(handle, linkid, bridge, sizeof (bridge));
373 return (bridge_door_call(bridge, dtype, linkid, &buf, inlen, &buflen,
378 bridge_refresh(const char *bridge)
389 status = bridge_door_call(bridge, bdcBridgeGetRefreshCount,
396 if ((fmri = alloc_fmri(BRIDGE_SVC_NAME, bridge)) == NULL)
414 status = bridge_door_call(bridge,
423 fmri = alloc_fmri(TRILL_SVC_NAME, bridge);
435 * Look up bridge property values from SCF and return them.
675 * Set private bridge parameters.
678 dladm_bridge_set_privprop(const char *bridge, boolean_t debug,
688 if (scf_service_get_instance(sstate.ss_svc, bridge, sstate.ss_inst)
722 if (rv == 1 && (fmri = alloc_fmri(BRIDGE_SVC_NAME, bridge)) != NULL) {
739 * Create the datalink entry for the bridge. Note that all of
748 /* Convert bridge protection option string to dladm_bridge_prot_t */
761 /* Convert bridge protection option from dladm_bridge_prot_t to string */
856 * dependencies will keep it from going on-line until the bridge is running.
965 * Create a new bridge or modify an existing one. Update the SMF configuration
1090 * If we're modifying an existing and running bridge, then tell the
1119 * Remove the bridge linkid if we've allocated one in this function but
1132 * Enable a newly-created bridge in SMF by creating "general/enabled" and
1142 * Set a link as a member of a bridge, or remove bridge membership. If the
1149 const char *bridge)
1157 if (*bridge != '\0' && !dladm_valid_bridgename(bridge))
1169 * Don't allow a link to be reassigned directly from one bridge
1172 if (*oldbridge != '\0' && *bridge != '\0') {
1181 if (*bridge != '\0') {
1183 DLADM_TYPE_STR, bridge);
1198 if (bridge[0] == '\0')
1199 bridge = oldbridge;
1200 status = bridge_refresh(bridge);
1206 * Get the name of the bridge of which the given linkid is a member.
1209 dladm_bridge_getlink(dladm_handle_t handle, datalink_id_t linkid, char *bridge,
1219 *bridge = '\0';
1220 status = dladm_get_conf_field(handle, conf, FBRIDGE, bridge, bridgelen);
1221 if (status == DLADM_STATUS_OK && *bridge == '\0')
1231 char bridge[MAXLINKNAMELEN];
1234 status = dladm_bridge_getlink(handle, linkid, bridge, sizeof (bridge));
1238 status = bridge_refresh(bridge);
1252 char bridge[MAXLINKNAMELEN];
1258 status = dladm_get_conf_field(handle, conf, FBRIDGE, bridge,
1259 sizeof (bridge));
1260 if (status == DLADM_STATUS_OK && strcmp(bha->bha_bridge, bridge) == 0) {
1271 * Delete a previously created bridge.
1274 dladm_bridge_delete(dladm_handle_t handle, const char *bridge, uint32_t flags)
1281 if (!dladm_valid_bridgename(bridge))
1284 /* Get the datalink ID for this bridge */
1285 (void) snprintf(linkname, sizeof (linkname), "%s0", bridge);
1301 arg.bha_bridge = bridge;
1306 * bridge. If so, we fail the operation.
1316 if ((status = disable_trill(bridge, flags)) != DLADM_STATUS_OK)
1320 status = shut_down_instance(BRIDGE_SVC_NAME, bridge, flags);
1347 dladm_valid_bridgename(const char *bridge)
1349 size_t len = strnlen(bridge, MAXLINKNAMELEN);
1356 * The bridge name cannot start or end with a digit.
1358 if (isdigit(bridge[0]) || isdigit(bridge[len - 1]))
1362 * The legal characters within a bridge name are:
1365 for (cp = bridge; *cp != '\0'; cp++) {
1374 * Convert a bridge-related observability node name back into the name of the
1375 * bridge. Returns B_FALSE without making changes if the input name is not in
1391 * Get bridge property values from the running daemon and return them in a
1416 * Get bridge state from the running daemon and return in structure borrowed
1428 /* Returns list of ports (datalink_id_t values) assigned to a bridge instance */
1445 * part of the bridge instance. First entry in the array is the
1521 dladm_bridge_get_fwdtable(dladm_handle_t handle, const char *bridge,
1531 "%s0", bridge);
1566 dladm_bridge_get_trillnick(const char *bridge, uint_t *nnick)
1575 (void) strlcpy(brcopy, bridge, sizeof (brcopy));
1615 dladm_bridge_get_nick(const char *bridge)
1621 if (bind_instance(TRILL_SVC_NAME, bridge, &sstate) != 0)
1634 dladm_bridge_set_nick(const char *bridge, uint16_t nick)
1645 if (scf_service_get_instance(sstate.ss_svc, bridge, sstate.ss_inst) !=
1682 if (rv == 1 && (fmri = alloc_fmri(TRILL_SVC_NAME, bridge)) != NULL) {
1689 * Get the bridge name from the given linkid. Replace the final 0 in the link
1694 char *bridge, size_t len)
1699 bridge, len);
1701 bridge[strlen(bridge) - 1] = '\0';
1706 * Bring up a persistent bridge. The bridge's SMF instance is created and
1708 * SMF instance. This allows the bridge to be profile-specific.
1715 char bridge[MAXLINKNAMELEN];
1725 if ((status = i_dladm_bridge_name_from_linkid(handle, linkid, bridge,
1726 sizeof (bridge))) != DLADM_STATUS_OK)
1801 * Add the SMF instance for this bridge. dladm_configure_bridge()
1805 * the bridge.
1810 if (scf_service_add_instance(sstate.ss_svc, bridge, sstate.ss_inst)
1820 /* Configure bridge, set TRILL nickname and private bridge parameters */
1821 status = dladm_bridge_configure(handle, bridge, &cfg, bprot,
1825 dladm_bridge_set_nick(bridge, trillnick);
1826 dladm_bridge_set_privprop(bridge, debug, tablemax);
1828 /* Finally, enable the bridge */
1829 status = dladm_bridge_enable(bridge);
1847 * Bring up a previously created persistent bridge or all persistent bridges.
1865 * Bring down an active bridge. The bridge's configuration is stored in
1874 char bridge[MAXLINKNAMELEN];
1883 if ((status = i_dladm_bridge_name_from_linkid(handle, linkid, bridge,
1884 sizeof (bridge))) != DLADM_STATUS_OK)
1888 * Retrieve the bridge properties from the bridge and trill SMF
1892 if ((status = dladm_bridge_get_properties(bridge, &cfg, &bprot))
1895 if ((status = dladm_bridge_get_privprop(bridge, &debug, &tablemax))
1898 trillnick = dladm_bridge_get_nick(bridge);
1935 /* The following are private bridge parameters */
1954 * Disable and remove the instances of this bridge from
1955 * network/routing/trill and network/bridge SMF services.
1957 (void) disable_trill(bridge, DLADM_OPT_PERSIST);
1958 (void) shut_down_instance(BRIDGE_SVC_NAME, bridge, DLADM_OPT_PERSIST);
1971 * Bring down one bridge or all active bridges. Persistent configuration and
1972 * linkid mapping in dlmgmtd is not removed. Downed bridge(s) can be brought