To include the generated IANA and custom registry Information elements, in build.rs
add the following code
```rust use std::env;
use netgauzeipfixcode_generator::{Config, generate, RegistrySource, RegistryType, SourceConfig};
const IPFIX_URL: &str = "https://www.iana.org/assignments/ipfix/ipfix.xml";
fn main() { let outdir = env::varos("OUTDIR").expect("Couldn't find OUTDIR in OS env variables"); let manifestdir = env!("CARGOMANIFESTDIR"); let registrypath = std::path::Path::new(&manifestdir).join("registry"); // Add custom registry, the xml file must follow the IANA schema let nokiapath = registrypath .join("nokia.xml") .intoosstring() .intostring() .expect("Couldn't load nokia registry file"); let nokiasource = SourceConfig::new( RegistrySource::File(nokiapath), RegistryType::IanaXML, 637, "nokia".tostring(), "Nokia".tostring(), ); let ianasource = SourceConfig::new( RegistrySource::Http(IPFIXURL.tostring()), RegistryType::IanaXML, 0, "iana".tostring(), "IANA".tostring(), ); let configs = Config::new(ianasource, vec![nokiasource]); generate(&outdir, &configs).unwrap();
println!("cargo:rerun-if-changed=build.rs");
} ```