enum ofp10_port_state {
OFPPS10_STP_LISTEN = 0 << 8, /* Not learning or relaying frames. */
OFPPS10_STP_LEARN = 1 << 8, /* Learning but not relaying frames. */
OFPPS10_STP_FORWARD = 2 << 8, /* Learning and relaying frames. */
OFPPS10_STP_BLOCK = 3 << 8, /* Not part of spanning tree. */
OFPPS10_STP_MASK = 3 << 8 /* Bit mask for OFPPS10_STP_* values. */
};
Run Code Online (Sandbox Code Playgroud) 嗨我想在shell脚本中使用curl,如下所示,但我无法替换CURL中的变量$ line.请建议
while read line
do
echo "allowing mac $line"
curl -X POST -d '{"src-mac": "$line"}' http://localhost:8080/wm/firewall/rules/json
curl -X POST -d '{"dst-mac": "$line"}' http://localhost:8080/wm/firewall/rules/json
done < /home/floodlight/allowedmacs
Run Code Online (Sandbox Code Playgroud) 我想让函数返回特定节点的地址.但是编译器没有检测到我创建的节点数据类型结构.
struct node
{
int data;
node *link;
};
node *header,*current;
node traverse(int pos);
node *Linkedlist::traverse(int pos)
{
int location = 0;
current->link = header->link;
node *address = new node;
address->data = NULL;
address->link = NULL;
while(current->link != NULL)
{
if(location == pos)
{
cout <<current->link->data <<" "<< endl;
address->link=current->link;
}
location ++;
current->link = current->link->link;
}
return address->link;
}
Run Code Online (Sandbox Code Playgroud)