digraph p2p_arch {
	ranksep=.75;
	size = "7.5,7.5";

	edge [dir=none];

	subgraph cluster_wpa_gui {
		label = "wpa_gui";

		status -> Qt;
		scan -> Qt;
		network -> Qt;
		Qt -> peers;
		Qt -> WPS;
		Qt -> gui_ctrl;

		gui_ctrl [label="ctrl i/f"];
	}

	subgraph cluster_wpa_supplicant {
		label = "wpa_supplicant"

		ctrl_iface [label="ctrl i/f"];
		authenticator [label="Authenticator"];
		supplicant [label="Supplicant"];
		driver_iface [label="driver i/f"];
		p2p_module [label="P2P\nmodule"];
		wps_registrar [label="WPS\nRegistrar"];
		wps_enrollee [label="WPS\nEnrollee"];
		mgmt_entity [label="Management\nentity"];

		ctrl_iface -> mgmt_entity;
		p2p_module -> mgmt_entity;
		wps_registrar -> mgmt_entity;
		wps_enrollee -> mgmt_entity;
		mgmt_entity -> authenticator;
		mgmt_entity -> supplicant;
		mgmt_entity -> driver_iface;

		{ rank = same; mgmt_entity; p2p_module; }
	}

	subgraph cluster_wpa_cli {
		label = "wpa_cli -a"

		wpa_cli_action;
	}

	subgraph cluster_dnsmasq {
		label = "dnsmasq"

		dnsmasq;
	}

	subgraph cluster_dhclient {
		label = "dhclient"

		dhclient;
	}

	subgraph cluster_kernel {
		label = "Linux kernel"

		cfg80211 -> mac80211;
		netdev -> mac80211;
		mac80211 -> ath9k;
	}

	gui_ctrl -> ctrl_iface;
	wpa_cli_action -> ctrl_iface;

	driver_iface -> cfg80211;

	wpa_cli_action -> dnsmasq;
	wpa_cli_action -> dhclient;

	dnsmasq -> netdev;
	dhclient -> netdev;

	edge [color=blue,dir=both];
	p2p_module -> mgmt_entity -> driver_iface -> cfg80211 -> mac80211 -> ath9k;

	edge [color=green,dir=both];
	peers -> Qt -> gui_ctrl -> ctrl_iface -> mgmt_entity -> p2p_module;
}