public XmlElement ToXml(XmlDocument document) { XmlElement sourceNode = document.CreateElement("idmef:Source", "http://iana.org/idmef"); sourceNode.SetAttribute("ident", ident); sourceNode.SetAttribute("spoofed", spoofed.ToString()); if (i_face != null) { sourceNode.SetAttribute("interface", i_face); } if (node != null) { sourceNode.AppendChild(node.ToXml(document)); } if (user != null) { sourceNode.AppendChild(user.ToXml(document)); } if (process != null) { sourceNode.AppendChild(process.ToXml(document)); } if (service != null) { sourceNode.AppendChild(service.ToXml(document)); } return(sourceNode); }
public XmlElement ToXml(XmlDocument document) { XmlElement targetNode = document.CreateElement("idmef:Target", "http://iana.org/idmef"); targetNode.SetAttribute("ident", ident); targetNode.SetAttribute("decoy", decoy.ToString()); if (i_face != null) { targetNode.SetAttribute("interface", i_face); } if (node != null) { targetNode.AppendChild(node.ToXml(document)); } if (user != null) { targetNode.AppendChild(user.ToXml(document)); } if (process != null) { targetNode.AppendChild(process.ToXml(document)); } if (service != null) { targetNode.AppendChild(service.ToXml(document)); } if ((file != null) && (file.Length > 0)) { foreach (var f in file) { if (f != null) { targetNode.AppendChild(f.ToXml(document)); } } } return(targetNode); }