1 /* Blue Sky: File Systems in the Cloud
3 * Copyright (C) 2009 The Regents of the University of California
4 * Written by Michael Vrable <mvrable@cs.ucsd.edu>
9 /* Main entry point for an NFSv3 server which will proxy requests to a cloud
12 #include "mount_prot.h"
15 #include <rpc/pmap_clnt.h>
18 #include <sys/socket.h>
19 #include <netinet/in.h>
28 static uint8_t filesystem_key[16];
30 int main(int argc, char *argv[])
36 bluesky_crypt_random_bytes(filesystem_key, sizeof(filesystem_key));
37 printf("Filesystem key: ");
38 for (i = 0; i < sizeof(filesystem_key); i++) {
39 printf("%02x", filesystem_key[i]);
43 fs = bluesky_new_fs("export");
44 fs->encryption_key = filesystem_key;
47 root = bluesky_new_inode(BLUESKY_ROOT_INUM, fs, BLUESKY_DIRECTORY);
50 bluesky_insert_inode(fs, root);
53 file = bluesky_new_inode(bluesky_fs_alloc_inode(fs), fs, BLUESKY_REGULAR);
56 bluesky_insert_inode(fs, file);
57 bluesky_directory_insert(root, "demo", file->inum);
60 fprintf(stderr, "%s", "svc_run returned");