亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? associola.c

?? 在linux環境下的流控制傳輸協議(sctp)的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* Remove a transport from an association.  */void sctp_assoc_rm_peer(struct sctp_association *asoc,			struct sctp_transport *peer){	struct list_head	*pos;	struct sctp_transport	*transport;	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_rm_peer:association %p addr: ",				 " port: %d\n",				 asoc,				 (&peer->ipaddr),				 ntohs(peer->ipaddr.v4.sin_port));	/* If we are to remove the current retran_path, update it	 * to the next peer before removing this peer from the list.	 */	if (asoc->peer.retran_path == peer)		sctp_assoc_update_retran_path(asoc);	/* Remove this peer from the list. */	list_del(&peer->transports);	/* Get the first transport of asoc. */	pos = asoc->peer.transport_addr_list.next;	transport = list_entry(pos, struct sctp_transport, transports);	/* Update any entries that match the peer to be deleted. */	if (asoc->peer.primary_path == peer)		sctp_assoc_set_primary(asoc, transport);	if (asoc->peer.active_path == peer)		asoc->peer.active_path = transport;	if (asoc->peer.last_data_from == peer)		asoc->peer.last_data_from = transport;	/* If we remove the transport an INIT was last sent to, set it to	 * NULL. Combined with the update of the retran path above, this	 * will cause the next INIT to be sent to the next available	 * transport, maintaining the cycle.	 */	if (asoc->init_last_sent_to == peer)		asoc->init_last_sent_to = NULL;	asoc->peer.transport_count--;	sctp_transport_free(peer);}/* Add a transport address to an association.  */struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,					   const union sctp_addr *addr,					   const gfp_t gfp,					   const int peer_state){	struct sctp_transport *peer;	struct sctp_sock *sp;	unsigned short port;	sp = sctp_sk(asoc->base.sk);	/* AF_INET and AF_INET6 share common port field. */	port = ntohs(addr->v4.sin_port);	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_add_peer:association %p addr: ",				 " port: %d state:%d\n",				 asoc,				 addr,				 port,				 peer_state);	/* Set the port if it has not been set yet.  */	if (0 == asoc->peer.port)		asoc->peer.port = port;	/* Check to see if this is a duplicate. */	peer = sctp_assoc_lookup_paddr(asoc, addr);	if (peer) {		if (peer->state == SCTP_UNKNOWN) {			if (peer_state == SCTP_ACTIVE)				peer->state = SCTP_ACTIVE;			if (peer_state == SCTP_UNCONFIRMED)				peer->state = SCTP_UNCONFIRMED;		}		return peer;	}	peer = sctp_transport_new(addr, gfp);	if (!peer)		return NULL;	sctp_transport_set_owner(peer, asoc);	/* Initialize the peer's heartbeat interval based on the	 * association configured value.	 */	peer->hbinterval = asoc->hbinterval;	/* Set the path max_retrans.  */	peer->pathmaxrxt = asoc->pathmaxrxt;	/* Initialize the peer's SACK delay timeout based on the	 * association configured value.	 */	peer->sackdelay = asoc->sackdelay;	/* Enable/disable heartbeat, SACK delay, and path MTU discovery	 * based on association setting.	 */	peer->param_flags = asoc->param_flags;	/* Initialize the pmtu of the transport. */	if (peer->param_flags & SPP_PMTUD_ENABLE)		sctp_transport_pmtu(peer);	else if (asoc->pathmtu)		peer->pathmtu = asoc->pathmtu;	else		peer->pathmtu = SCTP_DEFAULT_MAXSEGMENT;	/* If this is the first transport addr on this association,	 * initialize the association PMTU to the peer's PMTU.	 * If not and the current association PMTU is higher than the new	 * peer's PMTU, reset the association PMTU to the new peer's PMTU.	 */	if (asoc->pathmtu)		asoc->pathmtu = min_t(int, peer->pathmtu, asoc->pathmtu);	else		asoc->pathmtu = peer->pathmtu;	SCTP_DEBUG_PRINTK("sctp_assoc_add_peer:association %p PMTU set to "			  "%d\n", asoc, asoc->pathmtu);	asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu);	/* The asoc->peer.port might not be meaningful yet, but	 * initialize the packet structure anyway.	 */	sctp_packet_init(&peer->packet, peer, asoc->base.bind_addr.port,			 asoc->peer.port);	/* 7.2.1 Slow-Start	 *	 * o The initial cwnd before DATA transmission or after a sufficiently	 *   long idle period MUST be set to	 *      min(4*MTU, max(2*MTU, 4380 bytes))	 *	 * o The initial value of ssthresh MAY be arbitrarily high	 *   (for example, implementations MAY use the size of the	 *   receiver advertised window).	 */	peer->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));	/* At this point, we may not have the receiver's advertised window,	 * so initialize ssthresh to the default value and it will be set	 * later when we process the INIT.	 */	peer->ssthresh = SCTP_DEFAULT_MAXWINDOW;	peer->partial_bytes_acked = 0;	peer->flight_size = 0;	/* Set the transport's RTO.initial value */	peer->rto = asoc->rto_initial;	/* Set the peer's active state. */	peer->state = peer_state;	/* Attach the remote transport to our asoc.  */	list_add_tail(&peer->transports, &asoc->peer.transport_addr_list);	asoc->peer.transport_count++;	/* If we do not yet have a primary path, set one.  */	if (!asoc->peer.primary_path) {		sctp_assoc_set_primary(asoc, peer);		asoc->peer.retran_path = peer;	}	if (asoc->peer.active_path == asoc->peer.retran_path) {		asoc->peer.retran_path = peer;	}	return peer;}/* Delete a transport address from an association.  */void sctp_assoc_del_peer(struct sctp_association *asoc,			 const union sctp_addr *addr){	struct list_head	*pos;	struct list_head	*temp;	struct sctp_transport	*transport;	list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {		transport = list_entry(pos, struct sctp_transport, transports);		if (sctp_cmp_addr_exact(addr, &transport->ipaddr)) {			/* Do book keeping for removing the peer and free it. */			sctp_assoc_rm_peer(asoc, transport);			break;		}	}}/* Lookup a transport by address. */struct sctp_transport *sctp_assoc_lookup_paddr(					const struct sctp_association *asoc,					const union sctp_addr *address){	struct sctp_transport *t;	struct list_head *pos;	/* Cycle through all transports searching for a peer address. */	list_for_each(pos, &asoc->peer.transport_addr_list) {		t = list_entry(pos, struct sctp_transport, transports);		if (sctp_cmp_addr_exact(address, &t->ipaddr))			return t;	}	return NULL;}/* Remove all transports except a give one */void sctp_assoc_del_nonprimary_peers(struct sctp_association *asoc,				     struct sctp_transport *primary){	struct sctp_transport	*temp;	struct sctp_transport	*t;	list_for_each_entry_safe(t, temp, &asoc->peer.transport_addr_list,				 transports) {		/* if the current transport is not the primary one, delete it */		if (t != primary)			sctp_assoc_rm_peer(asoc, t);	}	return;}/* Engage in transport control operations. * Mark the transport up or down and send a notification to the user. * Select and update the new active and retran paths. */void sctp_assoc_control_transport(struct sctp_association *asoc,				  struct sctp_transport *transport,				  sctp_transport_cmd_t command,				  sctp_sn_error_t error){	struct sctp_transport *t = NULL;	struct sctp_transport *first;	struct sctp_transport *second;	struct sctp_ulpevent *event;	struct sockaddr_storage addr;	struct list_head *pos;	int spc_state = 0;	/* Record the transition on the transport.  */	switch (command) {	case SCTP_TRANSPORT_UP:		/* If we are moving from UNCONFIRMED state due		 * to heartbeat success, report the SCTP_ADDR_CONFIRMED		 * state to the user, otherwise report SCTP_ADDR_AVAILABLE.		 */		if (SCTP_UNCONFIRMED == transport->state &&		    SCTP_HEARTBEAT_SUCCESS == error)			spc_state = SCTP_ADDR_CONFIRMED;		else			spc_state = SCTP_ADDR_AVAILABLE;		transport->state = SCTP_ACTIVE;		break;	case SCTP_TRANSPORT_DOWN:		/* if the transort was never confirmed, do not transition it		 * to inactive state.		 */		if (transport->state != SCTP_UNCONFIRMED)			transport->state = SCTP_INACTIVE;		spc_state = SCTP_ADDR_UNREACHABLE;		break;	default:		return;	}	/* Generate and send a SCTP_PEER_ADDR_CHANGE notification to the	 * user.	 */	memset(&addr, 0, sizeof(struct sockaddr_storage));	memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len);	event = sctp_ulpevent_make_peer_addr_change(asoc, &addr,				0, spc_state, error, GFP_ATOMIC);	if (event)		sctp_ulpq_tail_event(&asoc->ulpq, event);	/* Select new active and retran paths. */	/* Look for the two most recently used active transports.	 *	 * This code produces the wrong ordering whenever jiffies	 * rolls over, but we still get usable transports, so we don't	 * worry about it.	 */	first = NULL; second = NULL;	list_for_each(pos, &asoc->peer.transport_addr_list) {		t = list_entry(pos, struct sctp_transport, transports);		if ((t->state == SCTP_INACTIVE) ||		    (t->state == SCTP_UNCONFIRMED))			continue;		if (!first || t->last_time_heard > first->last_time_heard) {			second = first;			first = t;		}		if (!second || t->last_time_heard > second->last_time_heard)			second = t;	}	/* RFC 2960 6.4 Multi-Homed SCTP Endpoints	 *	 * By default, an endpoint should always transmit to the	 * primary path, unless the SCTP user explicitly specifies the	 * destination transport address (and possibly source	 * transport address) to use.	 *	 * [If the primary is active but not most recent, bump the most	 * recently used transport.]	 */	if (((asoc->peer.primary_path->state == SCTP_ACTIVE) ||	     (asoc->peer.primary_path->state == SCTP_UNKNOWN)) &&	    first != asoc->peer.primary_path) {		second = first;		first = asoc->peer.primary_path;	}	/* If we failed to find a usable transport, just camp on the	 * primary, even if it is inactive.	 */	if (!first) {		first = asoc->peer.primary_path;		second = asoc->peer.primary_path;	}	/* Set the active and retran transports.  */	asoc->peer.active_path = first;	asoc->peer.retran_path = second;}/* Hold a reference to an association. */void sctp_association_hold(struct sctp_association *asoc){	atomic_inc(&asoc->base.refcnt);}/* Release a reference to an association and cleanup * if there are no more references. */void sctp_association_put(struct sctp_association *asoc){	if (atomic_dec_and_test(&asoc->base.refcnt))		sctp_association_destroy(asoc);}/* Allocate the next TSN, Transmission Sequence Number, for the given * association. */__u32 sctp_association_get_next_tsn(struct sctp_association *asoc){	/* From Section 1.6 Serial Number Arithmetic:	 * Transmission Sequence Numbers wrap around when they reach	 * 2**32 - 1.  That is, the next TSN a DATA chunk MUST use	 * after transmitting TSN = 2*32 - 1 is TSN = 0.	 */	__u32 retval = asoc->next_tsn;	asoc->next_tsn++;	asoc->unack_data++;	return retval;}/* Compare two addresses to see if they match.  Wildcard addresses * only match themselves. */int sctp_cmp_addr_exact(const union sctp_addr *ss1,			const union sctp_addr *ss2){	struct sctp_af *af;	af = sctp_get_af_specific(ss1->sa.sa_family);	if (unlikely(!af))		return 0;	return af->cmp_addr(ss1, ss2);}/* Return an ecne chunk to get prepended to a packet. * Note:  We are sly and return a shared, prealloced chunk.  FIXME: * No we don't, but we could/should. */struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc){	struct sctp_chunk *chunk;	/* Send ECNE if needed.	 * Not being able to allocate a chunk here is not deadly.	 */	if (asoc->need_ecne)		chunk = sctp_make_ecne(asoc, asoc->last_ecne_tsn);	else		chunk = NULL;	return chunk;}/* * Find which transport this TSN was sent on. */struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,					     __u32 tsn){	struct sctp_transport *active;	struct sctp_transport *match;	struct list_head *entry, *pos;	struct sctp_transport *transport;	struct sctp_chunk *chunk;	__be32 key = htonl(tsn);	match = NULL;	/*	 * FIXME: In general, find a more efficient data structure for	 * searching.	 */	/*	 * The general strategy is to search each transport's transmitted	 * list.   Return which transport this TSN lives on.	 *	 * Let's be hopeful and check the active_path first.	 * Another optimization would be to know if there is only one	 * outbound path and not have to look for the TSN at all.	 *	 */	active = asoc->peer.active_path;	list_for_each(entry, &active->transmitted) {		chunk = list_entry(entry, struct sctp_chunk, transmitted_list);		if (key == chunk->subh.data_hdr->tsn) {			match = active;			goto out;		}	}	/* If not found, go search all the other transports. */	list_for_each(pos, &asoc->peer.transport_addr_list) {		transport = list_entry(pos, struct sctp_transport, transports);		if (transport == active)			break;		list_for_each(entry, &transport->transmitted) {			chunk = list_entry(entry, struct sctp_chunk,					   transmitted_list);			if (key == chunk->subh.data_hdr->tsn) {				match = transport;				goto out;			}		}	}out:	return match;}/* Is this the association we are looking for? */struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc,					   const union sctp_addr *laddr,					   const union sctp_addr *paddr){	struct sctp_transport *transport;	if ((htons(asoc->base.bind_addr.port) == laddr->v4.sin_port) &&	    (htons(asoc->peer.port) == paddr->v4.sin_port)) {		transport = sctp_assoc_lookup_paddr(asoc, paddr);		if (!transport)			goto out;		if (sctp_bind_addr_match(&asoc->base.bind_addr, laddr,					 sctp_sk(asoc->base.sk)))			goto out;	}	transport = NULL;out:	return transport;}/* Do delayed input processing.  This is scheduled by sctp_rcv(). */static void sctp_assoc_bh_rcv(struct work_struct *work){	struct sctp_association *asoc =		container_of(work, struct sctp_association,			     base.inqueue.immediate);	struct sctp_endpoint *ep;	struct sctp_chunk *chunk;	struct sock *sk;	struct sctp_inq *inqueue;	int state;	sctp_subtype_t subtype;	int error = 0;	/* The association should be held so we should be safe. */	ep = asoc->ep;	sk = asoc->base.sk;	inqueue = &asoc->base.inqueue;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
香蕉加勒比综合久久| 国产女同性恋一区二区| 成人综合在线网站| 亚洲一区二区三区三| 国产亚洲欧美色| 欧美日韩国产欧美日美国产精品| 国产黄人亚洲片| 丝袜美腿亚洲一区二区图片| 中文字幕欧美一区| 精品国产sm最大网站| 欧美天天综合网| 成人的网站免费观看| 捆绑调教一区二区三区| 亚洲国产美女搞黄色| 国产精品国产三级国产a| 欧美一级艳片视频免费观看| 91美女在线看| 国产99久久久精品| 国内精品国产成人| 日本系列欧美系列| 亚洲成av人片一区二区| 亚洲视频你懂的| 欧美国产日韩亚洲一区| 欧美va在线播放| 91精品国产免费| 在线成人免费观看| 欧美在线一二三四区| a在线播放不卡| jizzjizzjizz欧美| 国产69精品一区二区亚洲孕妇 | 亚洲欧美影音先锋| 国产肉丝袜一区二区| 欧美xxxx老人做受| 日韩欧美国产一区在线观看| 宅男噜噜噜66一区二区66| 欧美午夜免费电影| 欧美亚洲高清一区| 91精品福利视频| 91麻豆123| 在线日韩av片| 欧美三日本三级三级在线播放| 色综合天天狠狠| 99精品视频在线观看| 一本色道久久综合狠狠躁的推荐| 不卡的看片网站| 91麻豆国产自产在线观看| 91小视频在线| 99re这里只有精品6| 一本久久综合亚洲鲁鲁五月天 | 欧美日韩精品一二三区| 欧美视频日韩视频在线观看| 91天堂素人约啪| 91日韩在线专区| 成人爽a毛片一区二区免费| 亚洲电影视频在线| 香蕉久久夜色精品国产使用方法| 亚洲综合在线电影| 中文字幕在线观看一区| 精品久久国产字幕高潮| 99麻豆久久久国产精品免费优播| 亚洲电影在线播放| 久久精品欧美一区二区三区不卡| 色婷婷av一区二区| 高清不卡在线观看av| 一本色道久久综合狠狠躁的推荐| 日韩欧美国产精品一区| 欧美国产一区在线| 国产精品伦一区| 欧美精品一区二区三区四区| 欧美一级高清片| 久久久无码精品亚洲日韩按摩| 日韩一区二区不卡| 精品美女在线播放| 精品电影一区二区| 亚洲国产精品精华液ab| 国产精品久久久久久久久免费樱桃 | 91蜜桃视频在线| 99久久精品免费精品国产| 99久久精品99国产精品| 欧美日韩三级在线| 精品国产乱码久久久久久闺蜜| 欧美xxxx老人做受| 日本一区二区视频在线| 日韩不卡免费视频| 久草中文综合在线| 99亚偷拍自图区亚洲| 欧美一区二区三区性视频| 欧美三区在线观看| av高清不卡在线| 欧亚洲嫩模精品一区三区| 日韩精品一区在线| 久久精品理论片| 成人免费视频在线观看| 91国偷自产一区二区开放时间| 久久91精品久久久久久秒播| 成人亚洲精品久久久久软件| 欧美日韩一区二区三区高清| 夜夜嗨av一区二区三区中文字幕| 国产精品三级视频| 香蕉久久夜色精品国产使用方法 | 精品成人佐山爱一区二区| 国产女人水真多18毛片18精品视频| 一级中文字幕一区二区| 国产麻豆视频一区| 91精品国产欧美一区二区| 美女视频一区二区| 国产三级三级三级精品8ⅰ区| 成人av在线资源网站| 久久99精品视频| 午夜精品一区二区三区电影天堂| 国产欧美视频在线观看| 欧美一级高清片| 欧美精品久久久久久久多人混战 | 精品国产免费久久| 色综合天天综合狠狠| 精品电影一区二区| 欧美无砖砖区免费| 国产成人精品亚洲午夜麻豆| 天堂在线一区二区| 亚洲六月丁香色婷婷综合久久| 久久九九国产精品| 日韩欧美精品在线视频| 欧美高清精品3d| 在线观看成人免费视频| 91原创在线视频| 91麻豆国产福利在线观看| 风间由美一区二区三区在线观看 | 国产成人综合视频| 久99久精品视频免费观看| 三级不卡在线观看| 爽好多水快深点欧美视频| 一卡二卡欧美日韩| 婷婷成人激情在线网| 亚洲1区2区3区视频| 日韩精品亚洲专区| 久久精品国产成人一区二区三区| 午夜精品久久久久久久久久 | 亚洲一区二区av在线| 五月婷婷激情综合网| 日韩av电影一区| 国产精品88av| 午夜精品影院在线观看| 国产婷婷一区二区| 欧日韩精品视频| 不卡在线视频中文字幕| 亚洲小少妇裸体bbw| www国产精品av| 欧美一区欧美二区| 99精品视频一区| 欧美日韩你懂得| 亚洲电影激情视频网站| 欧美久久久久免费| 免费观看在线色综合| 欧美成人高清电影在线| 激情五月婷婷综合| 久久久不卡网国产精品二区| 国产成人一区二区精品非洲| 国产精品欧美经典| 成人午夜视频网站| 97精品国产97久久久久久久久久久久 | 在线观看国产一区二区| 亚洲成人激情自拍| 欧美videos中文字幕| 成人app下载| 亚洲一卡二卡三卡四卡无卡久久 | 久久久蜜臀国产一区二区| 岛国一区二区三区| 一区二区三区不卡视频| 欧美一个色资源| 国产成人精品免费网站| 亚洲男同性恋视频| 欧美一区中文字幕| 国产高清在线观看免费不卡| 亚洲精品一二三| 日韩视频一区二区三区在线播放| 国产成人亚洲综合a∨婷婷图片 | 欧美tk丨vk视频| 成人永久看片免费视频天堂| 亚洲综合一区二区| 精品国产成人在线影院| 91麻豆精品国产91久久久更新时间| 国产精品免费免费| 91免费国产在线| 欧美aaa在线| 国产精品久久久久aaaa| 欧美亚洲国产一区二区三区| 国内精品不卡在线| 一级中文字幕一区二区| 久久这里只有精品首页| 欧美性做爰猛烈叫床潮| 国产精品一区二区三区99| 亚洲精品成人精品456| 精品国产91久久久久久久妲己| 91天堂素人约啪| 韩国三级中文字幕hd久久精品| 亚洲精品乱码久久久久久| xfplay精品久久| 欧美日韩成人一区二区| av中文字幕不卡| 激情久久久久久久久久久久久久久久|