@Override
	@SuppressWarnings("rawtypes")
	public byte[] processMsdp(final Session session, final char[] data, final int dataSize, final Map<Object,Object> reportables)
	{
		try
		{
			final Map<String,Object> cmds=this.buildMsdpMap(data, dataSize);
			final ByteArrayOutputStream buf=new ByteArrayOutputStream();
			if(cmds.containsKey(MSDPCommand.REPORT.toString()))
			{
				synchronized(reportables)
				{
					final Object o=cmds.get(MSDPCommand.REPORT.toString());
					if(o instanceof String)
					{
						final MSDPVariable type=(MSDPVariable)CMath.s_valueOf(MSDPVariable.class, ((String)o).toUpperCase().trim());
						if(type != null)
							reportables.put(type, getMsdpComparable(session, type));
						buf.write(processMsdpSend(session,(String)o));
					}
					else
					if(o instanceof List)
						for(final Object o2 : ((List)o))
							if(o2 instanceof String)
							{
								final MSDPVariable type=(MSDPVariable)CMath.s_valueOf(MSDPVariable.class, ((String)o2).toUpperCase().trim());
								if(type != null)
									reportables.put(type, getMsdpComparable(session, type));
								buf.write(processMsdpSend(session,(String)o2));
							}
				}
			}
			if(cmds.containsKey(MSDPCommand.SEND.toString()))
			{
				final Object o=cmds.get(MSDPCommand.SEND.toString());
				if(o instanceof String)
				{
					buf.write(processMsdpSend(session,(String)o));
				}
				else
				if(o instanceof List)
					for(final Object o2 : ((List)o))
						if(o2 instanceof String)
						{
							buf.write(processMsdpSend(session,(String)o2));
						}
			}
			if(cmds.containsKey(MSDPCommand.LIST.toString()))
			{
				final Object o=cmds.get(MSDPCommand.LIST.toString());
				if(o instanceof String)
				{
					buf.write(Session.MSDP_VAR);buf.write(((String)o).getBytes(Session.MSDP_CHARSET));buf.write(Session.MSDP_VAL);buf.write(processMsdpList(session,(String)o,reportables));
				}
				else
				if(o instanceof List)
					for(final Object o2 : ((List)o))
						if(o2 instanceof String)
						{
							buf.write(Session.MSDP_VAR);buf.write(((String)o2).getBytes(Session.MSDP_CHARSET));buf.write(Session.MSDP_VAL);buf.write(processMsdpList(session,(String)o2,reportables));
						}
			}
			if(cmds.containsKey(MSDPCommand.UNREPORT.toString()))
			{
				final Object o=cmds.get(MSDPCommand.UNREPORT.toString());
				if(o instanceof String)
				{
					final MSDPVariable type=(MSDPVariable)CMath.s_valueOf(MSDPVariable.class, ((String)o).toUpperCase().trim());
					if(type != null)
						reportables.remove(type);
				}
				else
				if(o instanceof List)
					for(final Object o2 : ((List)o))
						if(o2 instanceof String)
						{
							final MSDPVariable type=(MSDPVariable)CMath.s_valueOf(MSDPVariable.class, ((String)o2).toUpperCase().trim());
							if(type != null)
								reportables.remove(type);
						}
			}
			if(cmds.containsKey(MSDPCommand.RESET.toString()))
			{
				final Object o=cmds.get(MSDPCommand.RESET.toString());
				if(o instanceof String)
				{
					resetMsdpConfigurable(session, (String)o);
				}
				else
				if(o instanceof List)
					for(final Object o2 : ((List)o))
						if(o2 instanceof String)
							resetMsdpConfigurable(session, (String)o2);
			}
			if(buf.size()==0)
				return null;
			final ByteArrayOutputStream bout = new ByteArrayOutputStream();
			bout.write(Session.TELNET_IAC); bout.write(Session.TELNET_SB); bout.write(Session.TELNET_MSDP);
			bout.write(buf.toByteArray()); bout.write(Session.TELNET_IAC); bout.write(Session.TELNET_SE);
			return bout.toByteArray();
		}
		catch(final IOException e)
		{
			return null;
		}
	}