import ultra.FNT;
MultiForwardingUDR createMultiForwardingUDR(string dir, string file, bytearray fileContent) {
//Create the FNTUDR
FNTUDR fntudr = udrCreate(FNTUDR);
fntAddString(fntudr, dir);
fntAddDirDelimiter(fntudr); //Add a directory
fntAddString(fntudr, file); //Add a file
MultiForwardingUDR multiForwardingUDR = udrCreate(MultiForwardingUDR);
multiForwardingUDR.fntSpecification = fntudr;
multiForwardingUDR.content = fileContent;
return multiForwardingUDR;
}
consume {
bytearray file1Content;
strToBA (file1Content, "file nr 1 content");
bytearray file2Content;
strToBA (file2Content, "file nr 2 content");
//Send MultiForwardingUDRs to the forwarding agent
udrRoute(createMultiForwardingUDR("dir1", "file1", file1Content));
udrRoute(createMultiForwardingUDR("dir2", "file2", file2Content));
} |