libnfs

From WiiBrew
Jump to navigation Jump to search

libnfs
General
Author(s)r-win
TypeLibrary
VersionApril 24, 2012
LicenceGNU GPL v2
Links
Download
Source

libnfs is written from scratch for the Nintendo GameCube/Wii, modeled on the libfat interface. This library was develop from scratch, because most libraries out there rely on the RPC system available on most systems. Since the Wii doesn't have RPC (and doesn't need too), I had to create something that would be able to send and receive RPC messages instead. After that part was done, I decided to write my own implementation of the NFS protocol, instead of copying other code. Some code is used from libfat, like the locks and memory codes.

Features

  • Mounting of remote mountpoints
  • Full read/write, files of any size can be created, modified, renamed, moved, or deleted.
  • Directory junction walking
  • Devoptab support
  • NFS v3

Unsupported

The EXPORT call is unsupported at the moment, so you cannot ask for a list of remote mountpoints yet. Also, READDIR is not added, but READDIRPLUS is. I might change that in the future. SYMLINK and READLINK are the last missing method. The rest is implemented.

The NFS v4 protocol is much more complicated, although it has support for a few nice tricks (like COMPOUND). This may be added in the future.


Getting the latest sources

To grab the latest and greatest copy of the sources just type:

svn checkout http://libnfs-wii.googlecode.com/svn/trunk/


Compiling and Installing

Make sure you have devKitPPC and the latest libogc installed. Then from the sources root directory, type:

make
make install      # or 'sudo make install' if you aren't root.


Usage

NFS related routines can be accessed by adding the following line to your source file(s).

#include <nfs.h>

When compiling you must also link against libnfs. To do this, add -lnfs to the LIBS section of your application Makefile; for example:

LIBS := -lwiiuse -lbte -lnfs -lfat -logc -lm


Changelog

April 24, 2012

Initial commit of the first version, which has support for almost all methods in the NFS v3 protocol


Credits

Thanks goes to Dimok and daveboal, who helped me remember some stuff that I already forgot ;) Also to Rodries, who worked with Dimok on UDP sockets, which are used in this library.