// _SendRequestReply
status_t
AuthenticationServer::_SendRequestReply(port_id port, int32 token,
	status_t error, bool cancelled, const char* user, const char* password)
{
	// prepare the reply
	KMessage reply;
	reply.AddInt32("error", error);
	if (error == B_OK) {
		reply.AddBool("cancelled", cancelled);
		if (!cancelled) {
			reply.AddString("user", user);
			reply.AddString("password", password);
		}
	}
	// send the reply
	return reply.SendTo(port, token);
}
예제 #2
0
status_t
notify_interface_removed(net_interface* interface)
{
	if (sNotificationModule == NULL)
		return B_NOT_SUPPORTED;

	char messageBuffer[512];
	KMessage message;
	message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR);
	message.AddInt32("opcode", B_NETWORK_INTERFACE_REMOVED);
	message.AddString("interface", interface->name);

	return sNotificationModule->send_notification(&message);
}
예제 #3
0
status_t
notify_link_changed(net_device* device)
{
	if (sNotificationModule == NULL)
		return B_NOT_SUPPORTED;

	char messageBuffer[512];
	KMessage message;
	message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR);
	message.AddInt32("opcode", B_NETWORK_DEVICE_LINK_CHANGED);
	message.AddString("device", device->name);
	message.AddInt32("media", device->media);
	message.AddInt64("link speed", device->link_speed);
	message.AddInt32("link quality", device->link_quality);

	return sNotificationModule->send_notification(&message);
}
예제 #4
0
void
ieee80211_notify_scan_done(struct ieee80211vap* vap)
{
	release_sem_etc(vap->iv_ifp->scan_done_sem, 1,
		B_DO_NOT_RESCHEDULE | B_RELEASE_ALL);

	TRACE("%s\n", __FUNCTION__);

	if (sNotificationModule != NULL) {
		char messageBuffer[512];
		KMessage message;
		message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR);
		message.AddInt32("opcode", B_NETWORK_WLAN_SCANNED);
		message.AddString("interface", vap->iv_ifp->device_name);

		sNotificationModule->send_notification(&message);
	}
}
예제 #5
0
status_t
notify_interface_changed(net_interface* interface, uint32 oldFlags,
	uint32 newFlags)
{
	if (sNotificationModule == NULL)
		return B_NOT_SUPPORTED;

	char messageBuffer[512];
	KMessage message;
	message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR);
	message.AddInt32("opcode", B_NETWORK_INTERFACE_CHANGED);
	message.AddString("interface", interface->name);
	if (oldFlags != newFlags) {
		message.AddInt32("old flags", oldFlags);
		message.AddInt32("new flags", newFlags);
	}

	return sNotificationModule->send_notification(&message);
}
예제 #6
0
void
ieee80211_notify_node_leave(struct ieee80211_node* ni)
{
	struct ieee80211vap* vap = ni->ni_vap;
	struct ifnet* ifp = vap->iv_ifp;

	if (ni == vap->iv_bss)
		if_link_state_change(ifp, LINK_STATE_DOWN);

	TRACE("%s\n", __FUNCTION__);

	if (sNotificationModule != NULL) {
		char messageBuffer[512];
		KMessage message;
		message.SetTo(messageBuffer, sizeof(messageBuffer), B_NETWORK_MONITOR);
		message.AddInt32("opcode", B_NETWORK_WLAN_LEFT);
		message.AddString("interface", ifp->device_name);
		// TODO: add data about the node

		sNotificationModule->send_notification(&message);
	}
}