+static int cegw_dump_job( struct sk_buff* skb, struct netlink_callback* cb )
+{
+ struct can_eth_gw* ceth;
+ struct eth_can_gw* ecan;
+ struct hlist_node* pos;
+ struct nlmsghdr* nlh;
+ int idx = 0;
+ int s_idx = cb->args[0];
+ int ifidx, type;
+ struct in_addr dst_ip;
+ unsigned short dst_port;
+
+ rcu_read_lock();
+ hlist_for_each_entry_rcu( ecan, pos, ð_can_job, list )
+ {
+
+ // if( idx < s_idx )
+ // goto cont1;
+
+ nlh = nlmsg_put( skb, 0, 0, 0, 0, 0 );
+
+ ifidx = ecan->dst_if_idx;
+ type = CGW_TYPE_ETH_CAN_UDP;
+ nla_put( skb, CGW_TYPE, sizeof(type), &type );
+ nlh->nlmsg_len += NLA_HDRLEN + NLA_ALIGN( sizeof(type) );
+
+ nla_put( skb, CGW_CAN_IF, sizeof(ifidx), &ifidx ); /* ToDo return */
+ nlh->nlmsg_len += NLA_HDRLEN + NLA_ALIGN( sizeof(ifidx) );
+cont1:
+ idx++;
+ }
+ rcu_read_unlock();
+
+ rcu_read_lock();
+ hlist_for_each_entry_rcu( ceth, pos, &can_eth_job, list )
+ {
+ // if( idx < s_idx )
+ // goto cont2;
+
+ nlh = nlmsg_put( skb, 0, 0, 0, 0, 0 );
+
+ ifidx = ceth->src_if_idx;
+ type = CGW_TYPE_CAN_ETH_UDP;
+ dst_ip = ceth->dst_addr;
+ dst_port = ceth->dst_port;
+
+ nla_put( skb, CGW_TYPE, sizeof(type), &type );
+ nlh->nlmsg_len += NLA_HDRLEN + NLA_ALIGN( sizeof(type) );
+
+ nla_put( skb, CGW_CAN_IF, sizeof(ifidx), &ifidx ); /* ToDo return */
+ nlh->nlmsg_len += NLA_HDRLEN + NLA_ALIGN( sizeof(ifidx) );
+
+ nla_put( skb, CGW_ETH_IP, sizeof(dst_ip), &dst_ip ); /* ToDo return */
+ nlh->nlmsg_len += NLA_HDRLEN + NLA_ALIGN( sizeof(dst_ip) );
+
+ nla_put( skb, CGW_ETH_PORT, sizeof(dst_port), &dst_port ); /* ToDo return */
+ nlh->nlmsg_len += NLA_HDRLEN + NLA_ALIGN( sizeof(dst_port) );
+
+ //nla_put( skb, CGW_ETH_IP, sizeof() IP_ADDR )
+cont2:
+ idx++;
+ }
+ rcu_read_unlock();
+
+ /* ToDo nlmsg_cancel */
+ cb->args[0] = idx;
+
+ return skb->len;
+}
+