[nfs] Rewrite NFS URI handling

Get the NFS URI manipulation code out of nfs_open.c.  The resulting
code is now much more readable.

Signed-off-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Marin Hannache
2014-05-16 16:43:08 +02:00
committed by Michael Brown
parent 2b4be69eee
commit f4e069bf2e
4 changed files with 228 additions and 90 deletions

View File

@@ -223,6 +223,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define ERRFILE_icmp ( ERRFILE_NET | 0x00390000 )
#define ERRFILE_ping ( ERRFILE_NET | 0x003a0000 )
#define ERRFILE_dhcpv6 ( ERRFILE_NET | 0x003b0000 )
#define ERRFILE_nfs_uri ( ERRFILE_NET | 0x003c0000 )
#define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 )
#define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 )

View File

@@ -0,0 +1,29 @@
#ifndef _IPXE_NFS_URI_H
#define _IPXE_NFS_URI_H
/** @file
*
* Network File System protocol URI handling functions
*
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/uri.h>
struct nfs_uri {
char *mountpoint;
char *filename;
char *path;
char *lookup_pos;
};
int nfs_uri_init ( struct nfs_uri *nfs_uri, const struct uri *uri );
int nfs_uri_next_mountpoint ( struct nfs_uri *uri );
int nfs_uri_symlink ( struct nfs_uri *uri, const char *symlink_value );
char *nfs_uri_mountpoint ( const struct nfs_uri *uri );
char *nfs_uri_next_path_component ( struct nfs_uri *uri );
void nfs_uri_free ( struct nfs_uri *uri );
#endif /* _IPXE_NFS_URI_H */