Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
1-Network_programming
提交
6563ceb3
1
1-Network_programming
项目概览
Achou.Wang
/
1-Network_programming
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
1
1-Network_programming
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6563ceb3
编写于
8月 31, 2015
作者:
I
isshe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm
上级
b712557c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
102 deletion
+0
-102
include/sctp_getnostrms.c
include/sctp_getnostrms.c
+0
-60
include/sockfd_to_family.c
include/sockfd_to_family.c
+0
-42
未找到文件。
include/sctp_getnostrms.c
已删除
100755 → 0
浏览文件 @
b712557c
/*==============================================================================\
* Copyright(C)2015 Chudai.
*
* File name : sctp_getnostrms.c
* Version : v1.0.0
* Author : 初代
* Date : 2015/08/18
* Description :
* Function list: 1.(static)sctp_address_to_associd();
* 2.sctp_get_no_strms();
* 3.
* History :
\*==============================================================================*/
#include "my.h"
#include <netinet/sctp.h>
#include <sys/socket.h>
#include <sys/types.h>
static
sctp_assoc_t
sctp_address_to_associd
(
int
sock_fd
,
struct
sockaddr
*
sa
,
socklen_t
salen
)
{
struct
sctp_paddrparams
sp
;
socklen_t
siz
;
siz
=
sizeof
(
struct
sctp_paddrparams
);
bzero
(
&
sp
,
siz
);
memcpy
(
&
sp
.
spp_address
,
sa
,
salen
);
sctp_opt_info
(
sock_fd
,
0
,
SCTP_PEER_ADDR_PARAMS
,
&
sp
,
&
siz
);
return
(
sp
.
spp_assoc_id
);
}
int
sctp_get_no_strms
(
int
sock_fd
,
struct
sockaddr
*
to
,
socklen_t
tolen
)
{
socklen_t
retsz
;
struct
sctp_status
status
;
retsz
=
sizeof
(
status
);
bzero
(
&
status
,
sizeof
(
status
));
//这句出问题.
//听说可以改成:tatus.sstat_assoc_id = sri.sinfo_assoc_id;
status
.
sstat_assoc_id
=
sctp_address_to_associd
(
sock_fd
,
to
,
tolen
);
my_getsockopt
(
sock_fd
,
IPPROTO_SCTP
,
SCTP_STATUS
,
&
status
,
&
retsz
);
return
(
status
.
sstat_outstrms
);
}
include/sockfd_to_family.c
已删除
100755 → 0
浏览文件 @
b712557c
/*==============================================================================\
* Copyright(C)2015 Chudai.
*
* File name : sockfd_to_family.c
* Version : v1.0.0
* Author : 初代
* Date : 2015/08/27
* Description : 用sockfd获取family(协议族)
* Function list: 1.
* 2.
* 3.
* History :
\*==============================================================================*/
#include "my.h"
int
sockfd_to_family
(
int
sockfd
)
{
struct
sockaddr_storage
ss
;
socklen_t
len
;
len
=
sizeof
(
ss
);
if
(
getsockname
(
sockfd
,
(
SA
*
)
&
ss
,
&
len
)
<
0
)
{
return
(
-
1
);
}
return
(
ss
.
ss_family
);
}
int
my_sockfd_to_family
(
int
sockfd
)
{
int
rc
=
0
;
if
(
(
rc
=
sockfd_to_family
(
sockfd
))
<
0
)
{
err_sys
(
"sockfd_to_family error"
);
}
return
(
rc
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录