## **************************************************************************
## For copyright and licensing terms, see the file named COPYING.
## **************************************************************************

# The old Mewburn rc has linkage from devd to various services for network interfaces.
# These rules replace the Mewburn rc linkage with linkage to nosh services.

notify 1 {
	match "system" "IFNET";
	match "subsystem"	"!usbus[0-9]+";
	match "type" "ATTACH";
	action "system-control is-service-manager-client 2>/dev/null && system-control reset netif@$subsystem";
};
attach 1 {
	media-type		"802.11";
	action "system-control is-service-manager-client 2>/dev/null && system-control reset netif@$subsystem";
};
detach 1 {
	media-type		"802.11";
	action "system-control is-service-manager-client 2>/dev/null && system-control stop netif@$subsystem";
};

notify 1 {
	match "system"		"IFNET";
	match "type"		"LINK_UP";
	media-type		"ethernet";
	action "system-control is-service-manager-client 2>/dev/null && system-control reset --verbose dhclient@$subsystem";
};
notify 1 {
	match "system"		"IFNET";
	match "type"		"LINK_UP";
	media-type		"802.11";
	action "system-control is-service-manager-client 2>/dev/null && system-control reset --verbose dhclient@$subsystem";
};

notify 1 {
	match "system"		"IFNET";
	match "type"		"LINK_DOWN";
	media-type		"ethernet";
	action "system-control is-service-manager-client 2>/dev/null && system-control stop --verbose dhclient@$subsystem";
};
notify 1 {
	match "system"		"IFNET";
	match "type"		"LINK_DOWN";
	media-type		"802.11";
	action "system-control is-service-manager-client 2>/dev/null && system-control stop --verbose dhclient@$subsystem";
};
