struct ip *ip = mtod(m, struct ip *);
struct mobip_h *mip = mtod(m, struct mobip_h *);
struct gre_softc *sc;
- int msiz, hlen;
-
- hlen = *offp;
+ int msiz;
if ((sc = gre_lookup(m, IPPROTO_MOBILE)) == NULL) {
/* No matching tunnel or tunnel is down. */
{
struct mbuf *oper;
u_int16_t nxt_todel;
- u_int32_t cum_ackp1, last_tsn, prev_tsn, post_tsn;
+ u_int32_t cum_ackp1, prev_tsn, post_tsn;
int tsize;
- u_char last_flags;
struct sctp_tmit_chunk *at, *prev, *next;
prev = next = NULL;
sctppcbinfo.ipi_gencnt_chunk++;
return;
} else {
- last_flags = at->rec.data.rcv_flags;
- last_tsn = at->rec.data.TSN_seq;
prev = at;
if (TAILQ_NEXT(at, sctp_next) == NULL) {
/*
struct sctp_tmit_chunk *chk;
u_int32_t tsn, gap;
struct mbuf *dmbuf;
- int indx, the_len;
+ int the_len;
u_int16_t strmno, strmseq;
struct mbuf *oper;
} else {
sctp_pegs[SCTP_RWND_DROPS]++;
}
- indx = *break_flag;
*break_flag = 1;
return (0);
}
unsigned int sack_length;
uint32_t send_s;
int some_on_streamwheel;
- long j;
int strike_enabled = 0, cnt_of_cacc = 0;
int accum_moved = 0;
int marking_allowed = 1;
* 12) Assure we will SACK if in shutdown_recv state.
*/
- j = 0;
sack_length = ntohs(ch->ch.chunk_length);
if (sack_length < sizeof(struct sctp_sack_chunk)) {
#ifdef SCTP_DEBUG
#endif
for (i = 0; i < num_str; i++) {
u_int16_t st;
- unsigned char *xx;
/* Convert */
- xx = (unsigned char *)&stseq[i];
st = ntohs(stseq[i].stream);
stseq[i].stream = st;
st = ntohs(stseq[i].sequence);
sctp_handle_abort(struct sctp_abort_chunk *cp,
struct sctp_tcb *stcb, struct sctp_nets *net)
{
- struct sctp_inpcb *inp;
-
#ifdef SCTP_DEBUG
if (sctp_debug_on & SCTP_DEBUG_INPUT2) {
kprintf("sctp_handle_abort: handling ABORT\n");
/* notify user of the abort and clean up... */
sctp_abort_notification(stcb, 0);
/* free the tcb */
- inp = stcb->sctp_ep;
sctp_free_assoc(stcb->sctp_ep, stcb);
#ifdef SCTP_DEBUG
if (sctp_debug_on & SCTP_DEBUG_INPUT2) {
int init_offset, initack_offset, initack_limit;
int retval;
int error = 0;
- u_int32_t old_tag;
/*
* find and validate the INIT chunk in the cookie (peer's info)
* the INIT should start after the cookie-echo header struct
}
/* process the INIT-ACK info (my info) */
- old_tag = asoc->my_vtag;
asoc->my_vtag = ntohl(initack_cp->init.initiate_tag);
asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams);
struct ip *iph;
struct mbuf *mat;
uint16_t ptype, plen;
- int err_at;
uint8_t fnd;
struct sctp_nets *net;
}
/* Ok so far lets munge through the rest of the packet */
mat = in_initpkt;
- err_at = 0;
sa_touse = NULL;
offset += sizeof(struct sctp_init_chunk);
phdr = sctp_get_next_param(mat, offset, ¶ms, sizeof(params));
}
} else {
if ((m->m_flags & M_PKTHDR) == 0) {
- struct mbuf *mat;
- mat = m;
ca->sndlen = 0;
while(m) {
ca->sndlen += m->m_len;
*/
struct sctp_tmit_chunk *chk;
struct mbuf *m_asconf;
- struct sctp_asconf_chunk *acp;
-
/* compose an ASCONF chunk, maximum length is PMTU */
m_asconf = sctp_compose_asconf(stcb);
if (m_asconf == NULL) {
return (-1);
}
- acp = mtod(m_asconf, struct sctp_asconf_chunk *);
chk = (struct sctp_tmit_chunk *)SCTP_ZONE_GET(sctppcbinfo.ipi_zone_chunk);
if (chk == NULL) {
/* no memory */
sctp_output(struct sctp_inpcb *inp, struct mbuf *m, struct sockaddr *addr,
struct mbuf *control, struct thread *p, int flags)
{
- struct inpcb *ip_inp;
struct sctp_inpcb *t_inp;
struct sctp_tcb *stcb;
struct sctp_nets *net;
crit_enter();
queue_only = 0;
- ip_inp = (struct inpcb *)inp;
stcb = NULL;
asoc = NULL;
net = NULL;
#endif
)
{
- unsigned int sndlen;
int error, use_rcvinfo;
int queue_only = 0, queue_only_for_init=0;
int un_sent = 0;
stcb = NULL;
asoc = NULL;
t_inp = inp = (struct sctp_inpcb *)so->so_pcb;
- if (uio)
- sndlen = uio->uio_resid;
- else
- sndlen = top->m_pkthdr.len;
-
crit_enter();
*/
struct sctp_inpcb *inp;
struct sctppcbhead *head;
- struct sockaddr_in *sin;
- struct sockaddr_in6 *sin6;
int lport;
#ifdef SCTP_DEBUG
if (sctp_debug_on & SCTP_DEBUG_PCB1) {
}
#endif
if (nam->sa_family == AF_INET) {
- sin = (struct sockaddr_in *)nam;
lport = ((struct sockaddr_in *)nam)->sin_port;
} else if (nam->sa_family == AF_INET6) {
- sin6 = (struct sockaddr_in6 *)nam;
lport = ((struct sockaddr_in6 *)nam)->sin6_port;
} else {
/* unsupported family */
* c) The hash of all associations.
* d) finally the ep itself.
*/
- struct sctp_pcb *m;
struct sctp_inpcb *inp_save;
struct sctp_tcb *asoc, *nasoc;
struct sctp_laddr *laddr, *nladdr;
inp->pkt = NULL;
}
so = inp->sctp_socket;
- m = &inp->sctp_ep;
ip_pcb = &inp->ip_inp.inp; /* we could just cast the main
* pointer here but I will
* be nice :> (i.e. ip_pcb = ep;)
sctp_findnet(struct sctp_tcb *stcb, struct sockaddr *addr)
{
struct sctp_nets *net;
+#if 0
struct sockaddr_in *sin;
- struct sockaddr_in6 *sin6;
+
+ /* why do we need to check the port for a nets list on an assoc? */
/* use the peer's/remote port for lookup if unspecified */
sin = (struct sockaddr_in *)addr;
- sin6 = (struct sockaddr_in6 *)addr;
-#if 0 /* why do we need to check the port for a nets list on an assoc? */
if (stcb->rport != sin->sin_port) {
/* we cheat and just a sin for this test */
return (NULL);
int
sctp_add_local_addr_assoc(struct sctp_tcb *stcb, struct ifaddr *ifa)
{
- struct sctp_inpcb *inp;
struct sctp_laddr *laddr;
int error;
* the INP. May need to confirm/fix that if
* we need it and is not the case.
*/
- inp = stcb->sctp_ep;
if (ifa->ifa_addr->sa_family == AF_INET6) {
struct in6_ifaddr *ifa6;
ifa6 = (struct in6_ifaddr *)ifa;
* period (in value1/value2) return RTO in number of usecs.
*/
int calc_time = 0;
- int o_calctime;
unsigned int new_rto = 0;
int first_measure = 0;
struct timeval now;
new_rto = net->lastsa + 4 * net->lastsv;
*/
#endif
- o_calctime = calc_time;
/* this is Van Jacobson's integer version */
if (net->RTO) {
calc_time -= (net->lastsa >> 3);
sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
int error, struct mbuf *op_err)
{
- u_int32_t vtag;
-
if (stcb == NULL) {
/* Got to have a TCB */
if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) {
}
return;
}
- vtag = stcb->asoc.peer_vtag;
/* notify the ulp */
if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0)
sctp_abort_notification(stcb, error);
struct mbuf *control, u_int32_t tag,
struct sctp_inpcb *inp)
{
- struct mbuf *m, *n, *nlast;
+ struct mbuf *m, *n;
int cnt=0;
if (m0 && (m0->m_flags & M_PKTHDR) == 0)
SOCKBUF_LOCK(ssb);
for (n = m; n; n = n->m_next)
sballoc(&ssb->sb, n);
- nlast = n;
if (ssb->ssb_mb == NULL) {
inp->sctp_vtag_first = tag;
}