]> git.droids-corp.org - dpdk.git/blobdiff - app/test-pmd/config.c
cryptodev: remove session init internal function
[dpdk.git] / app / test-pmd / config.c
index aa3550571d6a9040b1fed2a12096c272f2117f31..593677e568e59b440461ce9a1bf575c27f3c5aa1 100644 (file)
@@ -3309,6 +3309,27 @@ open_ddp_package_file(const char *file_path, uint32_t *size)
        return buf;
 }
 
+int
+save_ddp_package_file(const char *file_path, uint8_t *buf, uint32_t size)
+{
+       FILE *fh = fopen(file_path, "wb");
+
+       if (fh == NULL) {
+               printf("%s: Failed to open %s\n", __func__, file_path);
+               return -1;
+       }
+
+       if (fwrite(buf, 1, size, fh) != size) {
+               fclose(fh);
+               printf("%s: File write operation failed\n", __func__);
+               return -1;
+       }
+
+       fclose(fh);
+
+       return 0;
+}
+
 int
 close_ddp_package_file(uint8_t *buf)
 {