/*
* Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>.
*
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/interface.h>
/** @file
*
* Fibre Channel name server lookups
*
*/
/** A Fibre Channel name server query */
struct fc_ns_query {
/** Reference count */
/** Fibre Channel exchange */
/** Fibre Channel peer */
/** Fibre Channel port */
/** Process */
/** Success handler
*
* @v peer Fibre Channel peer
* @v port Fibre Channel port
* @v peer_port_id Peer port ID
* @ret rc Return status code
*/
struct fc_port_id *peer_port_id );
};
/**
* Free name server query
*
* @v refcnt Reference count
*/
}
/**
* Close name server query
*
* @v query Name server query
* @v rc Reason for close
*/
/* Stop process */
/* Shut down interfaces */
}
/**
* Receive name server query response
*
* @v query Name server query
* @v iobuf I/O buffer
* @v meta Data transfer metadata
* @ret rc Return status code
*/
int rc;
/* Sanity check */
goto done;
}
/* Handle response */
case FC_GS_ACCEPT:
"response (%zd bytes)\n",
goto done;
}
peer_port_id ) ) != 0 )
goto done;
break;
case FC_GS_REJECT:
break;
default:
goto done;
}
rc = 0;
done:
return rc;
}
/**
* Name server query process
*
* @v query Name server query
*/
int xchg_id;
int rc;
/* Create exchange */
FC_TYPE_CT ) ) < 0 ) {
return;
}
/* Construct query request */
/* Send query */
return;
}
}
/** Name server exchange interface operations */
};
/** Name server exchange interface descriptor */
/** Name server process descriptor */
/**
* Issue Fibre Channel name server query
*
* @v peer Fibre Channel peer
* @v port Fibre Channel port
* @ret rc Return status code
*/
struct fc_port_id *peer_port_id ) ) {
/* Allocate and initialise structure */
if ( ! query )
return -ENOMEM;
/* Mortalise self and return */
return 0;
}