*/intnfnlmsg_put(struct nl_msg *msg,uint32_tpid,uint32_tseq,uint8_tsubsys_id,uint8_ttype,intflags,uint8_tfamily,uint16_tres_id){structnlmsghdr*nlh;nlh =nlmsg_put(msg, pid, seq, NFNLMSG_TYPE(subsys_id, type),0, flags);if(nlh ==NULL)return-NLE_MSGSIZE;returnnfnlmsg_append(msg...
函数原型:static inline struct nlmsghdr *nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int payload, int flags) 返回类型:struct nlmsghdr 参数: 类型参数名称 struct sk_buff * skb u32 portid u32 seq int type int payload int flags 852...
消息头处理函数 1 nlmsg_put() 消息头处理宏 1 NETLINK_CB 2 NLMSG_DATA 附录 netlink协议清单 前言:netlink套接字1 netlink簇2 netlink数据结构2.1 消息地址:struct sockaddr_nl2.2 消息头 nlmsghdr参数:nlmsg_flags参数:type2.3 有效载荷属性nlattr2.4 属性期望2.5 struct netlink_kernel_cfg成员:API1. 创建...
err = -EINVAL;if(nla_put_buffer(nlmsg, IFA_LOCAL, addr, addrlen))gotoout;if(nla_put_buffer(nlmsg, IFA_ADDRESS, addr, addrlen))gotoout;if(nla_put_buffer(nlmsg, IFA_BROADCAST, bcast, addrlen))gotoout;/* TODO : multicast, anycast with ipv6 */err = -EPROTONOSUPPORT;if(family == ...
nlh = NLMSG_PUT(ub->skb,0, ub->qlen, ULOG_NL_EVENT,sizeof(*pm)+copy_len); ub->qlen++; pm =NLMSG_DATA(nlh);if(skb->tstamp.tv64 ==0) __net_timestamp((struct sk_buff *)skb); pm->data_len = copy_len; tv = ktime_to_timeval(skb->tstamp); ...
nlh = NLMSG_PUT(ub->skb,0, ub->qlen, ULOG_NL_EVENT,sizeof(*pm)+copy_len); ub->qlen++; pm =NLMSG_DATA(nlh);if(skb->tstamp.tv64 ==0) __net_timestamp((struct sk_buff *)skb); pm->data_len = copy_len; tv = ktime_to_timeval(skb->tstamp); ...
nla_put_failure: genlmsg_cancel(msg, hdr); free_msg: nlmsg_free(msg);return-EMSGSIZE; } 开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:29,代码来源:netlink.c 示例3: br_ifinfo_notify ▲点赞 3▼ voidbr_ifinfo_notify(intevent, struct net_bridge_port *port){structnet*net=dev...
rtnl_rule_put(rule);returnerr; errout_enomem: err = -NLE_NOMEM;gotoerrout; } 开发者ID:DELUXx,项目名称:android-wpasupplicant,代码行数:100,代码来源:rule.c 示例11: nfnl_log_alloc ▲点赞 1▼ struct nfnl_log *nfnlmsg_log_parse(struct nlmsghdr *nlh){structnfnl_log*log;structnlattr*tb...
ret = nla_put_u32(msg, DIRECTOR_A_DECISION, accept);if(ret !=0)gotoerror_del_resp; ret = send_request_message(state->handle, msg,0);gotodone; error_del_resp: nlmsg_free(msg); done:returnret; } 开发者ID:novyzde3,项目名称:CVUTClondike,代码行数:55,代码来源:immigration-request.c ...
nlh = nlmsg_put(skb,0,0,0,1200,0); nlh ->nlmsg_len=dlen; NETLINK_CB(skb).pid =0;/* 发自内核*/memcpy(NLMSG_DATA(nlh), data,strlen(data)); rc = netlink_unicast(nl_sk, skb, pid, MSG_DONTWAIT);if(rc <0) { printk("net_link: unicast skb error\n"); ...