~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/sctp/command.c

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SCTP kernel implementation Copyright (C) 1999-2001
  2  * Cisco, Motorola, and IBM
  3  * Copyright 2001 La Monte H.P. Yarroll
  4  *
  5  * This file is part of the SCTP kernel implementation
  6  *
  7  * These functions manipulate sctp command sequences.
  8  *
  9  * This SCTP implementation is free software;
 10  * you can redistribute it and/or modify it under the terms of
 11  * the GNU General Public License as published by
 12  * the Free Software Foundation; either version 2, or (at your option)
 13  * any later version.
 14  *
 15  * This SCTP implementation is distributed in the hope that it
 16  * will be useful, but WITHOUT ANY WARRANTY; without even the implied
 17  *                 ************************
 18  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 19  * See the GNU General Public License for more details.
 20  *
 21  * You should have received a copy of the GNU General Public License
 22  * along with GNU CC; see the file COPYING.  If not, see
 23  * <http://www.gnu.org/licenses/>.
 24  *
 25  * Please send any bug reports or fixes you make to the
 26  * email address(es):
 27  *    lksctp developers <linux-sctp@vger.kernel.org>
 28  *
 29  * Written or modified by:
 30  *    La Monte H.P. Yarroll <piggy@acm.org>
 31  *    Karl Knutson <karl@athena.chicago.il.us>
 32  */
 33 
 34 #include <linux/types.h>
 35 #include <net/sctp/sctp.h>
 36 #include <net/sctp/sm.h>
 37 
 38 /* Initialize a block of memory as a command sequence. */
 39 int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
 40 {
 41         memset(seq, 0, sizeof(sctp_cmd_seq_t));
 42         return 1;               /* We always succeed.  */
 43 }
 44 
 45 /* Add a command to a sctp_cmd_seq_t.
 46  * Return 0 if the command sequence is full.
 47  */
 48 void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
 49 {
 50         BUG_ON(seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS);
 51 
 52         seq->cmds[seq->next_free_slot].verb = verb;
 53         seq->cmds[seq->next_free_slot++].obj = obj;
 54 }
 55 
 56 /* Return the next command structure in a sctp_cmd_seq.
 57  * Returns NULL at the end of the sequence.
 58  */
 59 sctp_cmd_t *sctp_next_cmd(sctp_cmd_seq_t *seq)
 60 {
 61         sctp_cmd_t *retval = NULL;
 62 
 63         if (seq->next_cmd < seq->next_free_slot)
 64                 retval = &seq->cmds[seq->next_cmd++];
 65 
 66         return retval;
 67 }
 68 
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp