Subversion Repositories shark

Rev

Rev 984 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
629 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/**
22
 ------------
984 pj 23
 CVS :        $Id: netbuff.h,v 1.5 2005-03-28 17:54:27 pj Exp $
629 giacomo 24
 
25
 File:        $File$
984 pj 26
 Revision:    $Revision: 1.5 $
27
 Last update: $Date: 2005-03-28 17:54:27 $
629 giacomo 28
 ------------
29
**/
30
 
31
/*
32
 * Copyright (C) 2000 Luca Abeni
33
 *
34
 * This program is free software; you can redistribute it and/or modify
35
 * it under the terms of the GNU General Public License as published by
36
 * the Free Software Foundation; either version 2 of the License, or
37
 * (at your option) any later version.
38
 *
39
 * This program is distributed in the hope that it will be useful,
40
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
42
 * GNU General Public License for more details.
43
 *
44
 * You should have received a copy of the GNU General Public License
45
 * along with this program; if not, write to the Free Software
46
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
47
 *
48
 */
49
 
50
/* Author:      Luca Abeni                                      */
51
/* Date:        25/9/1997                                       */
52
 
53
/* File:        NetBuff.H                                       */
54
/* Revision:    1.00                                            */
55
 
56
#ifndef __NETBUFF_H__
57
#define __NETBUFF_H__
58
 
1689 fabio 59
#include <arch/sys/cdefs.h>
984 pj 60
#include <sem/sem/sem.h>
629 giacomo 61
 
62
__BEGIN_DECLS
63
 
64
typedef struct netbuff{
65
        BYTE *b;
66
        BYTE **pb;
67
        BYTE *free;
68
        BYTE nbuffs;
69
        sem_t buffersem;
70
} NETBUFF;
71
 
72
void netbuff_init(struct netbuff *netb, BYTE nbuffs, WORD buffdim);
73
void *netbuff_get(struct netbuff *netb, BYTE to);
74
void *netbuff_sequentialget(struct netbuff *netb, BYTE to);
75
void netbuff_release(struct netbuff *netb, void *m);
76
 
77
__END_DECLS
78
 
79
#endif