|
Packit |
eace71 |
/*
|
|
Packit |
eace71 |
* Copyright (c) 2009-2011, Broadcom Corporation
|
|
Packit |
eace71 |
* Copyright (c) 2014, QLogic Corporation
|
|
Packit |
eace71 |
*
|
|
Packit |
eace71 |
* Written by: Benjamin Li <benli@broadcom.com>
|
|
Packit |
eace71 |
* Based on code example from Adam Dunkels
|
|
Packit |
eace71 |
*
|
|
Packit |
eace71 |
* All rights reserved.
|
|
Packit |
eace71 |
*
|
|
Packit |
eace71 |
* Redistribution and use in source and binary forms, with or without
|
|
Packit |
eace71 |
* modification, are permitted provided that the following conditions
|
|
Packit |
eace71 |
* are met:
|
|
Packit |
eace71 |
* 1. Redistributions of source code must retain the above copyright
|
|
Packit |
eace71 |
* notice, this list of conditions and the following disclaimer.
|
|
Packit |
eace71 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
Packit |
eace71 |
* notice, this list of conditions and the following disclaimer in the
|
|
Packit |
eace71 |
* documentation and/or other materials provided with the distribution.
|
|
Packit |
eace71 |
* 3. All advertising materials mentioning features or use of this software
|
|
Packit |
eace71 |
* must display the following acknowledgement:
|
|
Packit |
eace71 |
* This product includes software developed by Adam Dunkels.
|
|
Packit |
eace71 |
* 4. The name of the author may not be used to endorse or promote
|
|
Packit |
eace71 |
* products derived from this software without specific prior
|
|
Packit |
eace71 |
* written permission.
|
|
Packit |
eace71 |
*
|
|
Packit |
eace71 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
|
Packit |
eace71 |
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
Packit |
eace71 |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
Packit |
eace71 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
Packit |
eace71 |
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
eace71 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
Packit |
eace71 |
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
Packit |
eace71 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
Packit |
eace71 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
Packit |
eace71 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
Packit |
eace71 |
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
eace71 |
*
|
|
Packit |
eace71 |
*/
|
|
Packit |
eace71 |
/**
|
|
Packit |
eace71 |
* \addtogroup apps
|
|
Packit |
eace71 |
* @{
|
|
Packit |
eace71 |
*/
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
/**
|
|
Packit |
eace71 |
* \defgroup helloworld Hello, world
|
|
Packit |
eace71 |
* @{
|
|
Packit |
eace71 |
*
|
|
Packit |
eace71 |
* A small example showing how to write applications with
|
|
Packit |
eace71 |
* \ref psock "protosockets".
|
|
Packit |
eace71 |
*/
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
/**
|
|
Packit |
eace71 |
* \file
|
|
Packit |
eace71 |
* Header file for an example of how to write uIP applications
|
|
Packit |
eace71 |
* with protosockets.
|
|
Packit |
eace71 |
* \author
|
|
Packit |
eace71 |
* Benjamin Li <benli@broadcom.com>
|
|
Packit |
eace71 |
*/
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
#ifndef __BRCM_ISCSI_H__
|
|
Packit |
eace71 |
#define __BRCM_ISCSI_H__
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
/* Since this file will be included by uip.h, we cannot include uip.h
|
|
Packit |
eace71 |
here. But we might need to include uipopt.h if we need the u8_t and
|
|
Packit |
eace71 |
u16_t datatypes. */
|
|
Packit |
eace71 |
#include "uipopt.h"
|
|
Packit |
eace71 |
#include "uip.h"
|
|
Packit |
eace71 |
#include "psock.h"
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
/* Next, we define the hello_world_state structure. This is the state
|
|
Packit |
eace71 |
of our application, and the memory required for this state is
|
|
Packit |
eace71 |
allocated together with each TCP connection. One application state
|
|
Packit |
eace71 |
for each TCP connection. */
|
|
Packit |
eace71 |
struct hello_world_state {
|
|
Packit |
eace71 |
struct psock p;
|
|
Packit |
eace71 |
u8_t inputbuffer[32];
|
|
Packit |
eace71 |
u8_t name[40];
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
struct uip_udp_conn *conn;
|
|
Packit |
eace71 |
};
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
/* Finally we define the application function to be called by uIP. */
|
|
Packit |
eace71 |
void brcm_iscsi_appcall(struct uip_stack *ustack);
|
|
Packit |
eace71 |
#ifndef UIP_APPCALL
|
|
Packit |
eace71 |
#define UIP_APPCALL brcm_iscsi_appcall
|
|
Packit |
eace71 |
#endif /* UIP_APPCALL */
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
void brcm_iscsi_init(void);
|
|
Packit |
eace71 |
|
|
Packit |
eace71 |
#endif /* __BRCM_ISCSI_H__ */
|
|
Packit |
eace71 |
/** @} */
|
|
Packit |
eace71 |
/** @} */
|