mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking updates from David Miller: 1) UAPI changes for networking from David Howells 2) A netlink dump is an operation we can sleep within, and therefore we need to make sure the dump provider module doesn't disappear on us meanwhile. Fix from Gao Feng. 3) Now that tunnels support GRO, we have to be more careful in skb_gro_reset_offset() otherwise we OOPS, from Eric Dumazet. 4) We can end up processing packets for VLANs we aren't actually configured to be on, fix from Florian Zumbiehl. 5) Fix routing cache removal regression in redirects and IPVS. The core issue on the IPVS side is that it wants to rewrite who the nexthop is and we have to explicitly accomodate that case. From Julian Anastasov. 6) Error code return fixes all over the networking drivers from Peter Senna Tschudin. 7) Fix routing cache removal regressions in IPSEC, from Steffen Klassert. 8) Fix deadlock in RDS during pings, from Jeff Liu. 9) Neighbour packet queue can trigger skb_under_panic() because we do not reset the network header of the SKB in the right spot. From Ramesh Nagappa. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (61 commits) RDS: fix rds-ping spinlock recursion netdev/phy: Prototype of_mdio_find_bus() farsync: fix support for over 30 cards be2net: Remove code that stops further access to BE NIC based on UE bits pch_gbe: Fix build error by selecting all the possible dependencies. e1000e: add device IDs for i218 ixgbe/ixgbevf: Limit maximum jumbo frame size to 9.5K to avoid Tx hangs ixgbevf: Set the netdev number of Tx queues UAPI: (Scripted) Disintegrate include/linux/tc_ematch UAPI: (Scripted) Disintegrate include/linux/tc_act UAPI: (Scripted) Disintegrate include/linux/netfilter_ipv6 UAPI: (Scripted) Disintegrate include/linux/netfilter_ipv4 UAPI: (Scripted) Disintegrate include/linux/netfilter_bridge UAPI: (Scripted) Disintegrate include/linux/netfilter_arp UAPI: (Scripted) Disintegrate include/linux/netfilter/ipset UAPI: (Scripted) Disintegrate include/linux/netfilter UAPI: (Scripted) Disintegrate include/linux/isdn UAPI: (Scripted) Disintegrate include/linux/caif net: fix typo in freescale/ucc_geth.c vxlan: fix more sparse warnings ...
This commit is contained in:
commit
aac2b1f574
238 changed files with 2394 additions and 2294 deletions
|
@ -3498,7 +3498,8 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct ibnl_client_cbs cma_cb_table[] = {
|
static const struct ibnl_client_cbs cma_cb_table[] = {
|
||||||
[RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats },
|
[RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats,
|
||||||
|
.module = THIS_MODULE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init cma_init(void)
|
static int __init cma_init(void)
|
||||||
|
|
|
@ -154,6 +154,7 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
|
||||||
{
|
{
|
||||||
struct netlink_dump_control c = {
|
struct netlink_dump_control c = {
|
||||||
.dump = client->cb_table[op].dump,
|
.dump = client->cb_table[op].dump,
|
||||||
|
.module = client->cb_table[op].module,
|
||||||
};
|
};
|
||||||
return netlink_dump_start(nls, skb, nlh, &c);
|
return netlink_dump_start(nls, skb, nlh, &c);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1845,6 +1845,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
|
||||||
if((pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM))==0){
|
if((pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM))==0){
|
||||||
printk(KERN_ERR "amd8111e: No Power Management capability, "
|
printk(KERN_ERR "amd8111e: No Power Management capability, "
|
||||||
"exiting.\n");
|
"exiting.\n");
|
||||||
|
err = -ENODEV;
|
||||||
goto err_free_reg;
|
goto err_free_reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1852,6 +1853,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
|
||||||
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) < 0) {
|
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) < 0) {
|
||||||
printk(KERN_ERR "amd8111e: DMA not supported,"
|
printk(KERN_ERR "amd8111e: DMA not supported,"
|
||||||
"exiting.\n");
|
"exiting.\n");
|
||||||
|
err = -ENODEV;
|
||||||
goto err_free_reg;
|
goto err_free_reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1174,8 +1174,10 @@ static int __devinit au1000_probe(struct platform_device *pdev)
|
||||||
snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
|
snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
|
||||||
pdev->name, aup->mac_id);
|
pdev->name, aup->mac_id);
|
||||||
aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
|
aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
|
||||||
if (aup->mii_bus->irq == NULL)
|
if (aup->mii_bus->irq == NULL) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < PHY_MAX_ADDR; ++i)
|
for (i = 0; i < PHY_MAX_ADDR; ++i)
|
||||||
aup->mii_bus->irq[i] = PHY_POLL;
|
aup->mii_bus->irq[i] = PHY_POLL;
|
||||||
|
@ -1190,7 +1192,8 @@ static int __devinit au1000_probe(struct platform_device *pdev)
|
||||||
goto err_mdiobus_reg;
|
goto err_mdiobus_reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (au1000_mii_probe(dev) != 0)
|
err = au1000_mii_probe(dev);
|
||||||
|
if (err != 0)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
|
||||||
pDBfree = NULL;
|
pDBfree = NULL;
|
||||||
|
@ -1205,6 +1208,7 @@ static int __devinit au1000_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
aup->pDBfree = pDBfree;
|
aup->pDBfree = pDBfree;
|
||||||
|
|
||||||
|
err = -ENODEV;
|
||||||
for (i = 0; i < NUM_RX_DMA; i++) {
|
for (i = 0; i < NUM_RX_DMA; i++) {
|
||||||
pDB = au1000_GetFreeDB(aup);
|
pDB = au1000_GetFreeDB(aup);
|
||||||
if (!pDB)
|
if (!pDB)
|
||||||
|
@ -1213,6 +1217,8 @@ static int __devinit au1000_probe(struct platform_device *pdev)
|
||||||
aup->rx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
|
aup->rx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
|
||||||
aup->rx_db_inuse[i] = pDB;
|
aup->rx_db_inuse[i] = pDB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = -ENODEV;
|
||||||
for (i = 0; i < NUM_TX_DMA; i++) {
|
for (i = 0; i < NUM_TX_DMA; i++) {
|
||||||
pDB = au1000_GetFreeDB(aup);
|
pDB = au1000_GetFreeDB(aup);
|
||||||
if (!pDB)
|
if (!pDB)
|
||||||
|
|
|
@ -375,7 +375,6 @@ struct xgmac_priv {
|
||||||
unsigned int tx_tail;
|
unsigned int tx_tail;
|
||||||
|
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
struct sk_buff_head rx_recycle;
|
|
||||||
unsigned int dma_buf_sz;
|
unsigned int dma_buf_sz;
|
||||||
dma_addr_t dma_rx_phy;
|
dma_addr_t dma_rx_phy;
|
||||||
dma_addr_t dma_tx_phy;
|
dma_addr_t dma_tx_phy;
|
||||||
|
@ -672,9 +671,7 @@ static void xgmac_rx_refill(struct xgmac_priv *priv)
|
||||||
p = priv->dma_rx + entry;
|
p = priv->dma_rx + entry;
|
||||||
|
|
||||||
if (priv->rx_skbuff[entry] == NULL) {
|
if (priv->rx_skbuff[entry] == NULL) {
|
||||||
skb = __skb_dequeue(&priv->rx_recycle);
|
skb = netdev_alloc_skb(priv->dev, priv->dma_buf_sz);
|
||||||
if (skb == NULL)
|
|
||||||
skb = netdev_alloc_skb(priv->dev, priv->dma_buf_sz);
|
|
||||||
if (unlikely(skb == NULL))
|
if (unlikely(skb == NULL))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -887,17 +884,7 @@ static void xgmac_tx_complete(struct xgmac_priv *priv)
|
||||||
desc_get_buf_len(p), DMA_TO_DEVICE);
|
desc_get_buf_len(p), DMA_TO_DEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
dev_kfree_skb(skb);
|
||||||
* If there's room in the queue (limit it to size)
|
|
||||||
* we add this skb back into the pool,
|
|
||||||
* if it's the right size.
|
|
||||||
*/
|
|
||||||
if ((skb_queue_len(&priv->rx_recycle) <
|
|
||||||
DMA_RX_RING_SZ) &&
|
|
||||||
skb_recycle_check(skb, priv->dma_buf_sz))
|
|
||||||
__skb_queue_head(&priv->rx_recycle, skb);
|
|
||||||
else
|
|
||||||
dev_kfree_skb(skb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) >
|
if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) >
|
||||||
|
@ -1016,7 +1003,6 @@ static int xgmac_open(struct net_device *dev)
|
||||||
dev->dev_addr);
|
dev->dev_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_queue_head_init(&priv->rx_recycle);
|
|
||||||
memset(&priv->xstats, 0, sizeof(struct xgmac_extra_stats));
|
memset(&priv->xstats, 0, sizeof(struct xgmac_extra_stats));
|
||||||
|
|
||||||
/* Initialize the XGMAC and descriptors */
|
/* Initialize the XGMAC and descriptors */
|
||||||
|
@ -1053,7 +1039,6 @@ static int xgmac_stop(struct net_device *dev)
|
||||||
napi_disable(&priv->napi);
|
napi_disable(&priv->napi);
|
||||||
|
|
||||||
writel(0, priv->base + XGMAC_DMA_INTR_ENA);
|
writel(0, priv->base + XGMAC_DMA_INTR_ENA);
|
||||||
skb_queue_purge(&priv->rx_recycle);
|
|
||||||
|
|
||||||
/* Disable the MAC core */
|
/* Disable the MAC core */
|
||||||
xgmac_mac_disable(priv->base);
|
xgmac_mac_disable(priv->base);
|
||||||
|
|
|
@ -696,6 +696,7 @@ int t4_seeprom_wp(struct adapter *adapter, bool enable);
|
||||||
int get_vpd_params(struct adapter *adapter, struct vpd_params *p);
|
int get_vpd_params(struct adapter *adapter, struct vpd_params *p);
|
||||||
int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
|
int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
|
||||||
unsigned int t4_flash_cfg_addr(struct adapter *adapter);
|
unsigned int t4_flash_cfg_addr(struct adapter *adapter);
|
||||||
|
int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size);
|
||||||
int t4_check_fw_version(struct adapter *adapter);
|
int t4_check_fw_version(struct adapter *adapter);
|
||||||
int t4_prep_adapter(struct adapter *adapter);
|
int t4_prep_adapter(struct adapter *adapter);
|
||||||
int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
|
int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
|
||||||
|
|
|
@ -443,7 +443,10 @@ int dbfifo_int_thresh = 10; /* 10 == 640 entry threshold */
|
||||||
module_param(dbfifo_int_thresh, int, 0644);
|
module_param(dbfifo_int_thresh, int, 0644);
|
||||||
MODULE_PARM_DESC(dbfifo_int_thresh, "doorbell fifo interrupt threshold");
|
MODULE_PARM_DESC(dbfifo_int_thresh, "doorbell fifo interrupt threshold");
|
||||||
|
|
||||||
int dbfifo_drain_delay = 1000; /* usecs to sleep while draining the dbfifo */
|
/*
|
||||||
|
* usecs to sleep while draining the dbfifo
|
||||||
|
*/
|
||||||
|
static int dbfifo_drain_delay = 1000;
|
||||||
module_param(dbfifo_drain_delay, int, 0644);
|
module_param(dbfifo_drain_delay, int, 0644);
|
||||||
MODULE_PARM_DESC(dbfifo_drain_delay,
|
MODULE_PARM_DESC(dbfifo_drain_delay,
|
||||||
"usecs to sleep while draining the dbfifo");
|
"usecs to sleep while draining the dbfifo");
|
||||||
|
@ -636,7 +639,7 @@ static void name_msix_vecs(struct adapter *adap)
|
||||||
static int request_msix_queue_irqs(struct adapter *adap)
|
static int request_msix_queue_irqs(struct adapter *adap)
|
||||||
{
|
{
|
||||||
struct sge *s = &adap->sge;
|
struct sge *s = &adap->sge;
|
||||||
int err, ethqidx, ofldqidx = 0, rdmaqidx = 0, msi = 2;
|
int err, ethqidx, ofldqidx = 0, rdmaqidx = 0, msi_index = 2;
|
||||||
|
|
||||||
err = request_irq(adap->msix_info[1].vec, t4_sge_intr_msix, 0,
|
err = request_irq(adap->msix_info[1].vec, t4_sge_intr_msix, 0,
|
||||||
adap->msix_info[1].desc, &s->fw_evtq);
|
adap->msix_info[1].desc, &s->fw_evtq);
|
||||||
|
@ -644,56 +647,60 @@ static int request_msix_queue_irqs(struct adapter *adap)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
for_each_ethrxq(s, ethqidx) {
|
for_each_ethrxq(s, ethqidx) {
|
||||||
err = request_irq(adap->msix_info[msi].vec, t4_sge_intr_msix, 0,
|
err = request_irq(adap->msix_info[msi_index].vec,
|
||||||
adap->msix_info[msi].desc,
|
t4_sge_intr_msix, 0,
|
||||||
|
adap->msix_info[msi_index].desc,
|
||||||
&s->ethrxq[ethqidx].rspq);
|
&s->ethrxq[ethqidx].rspq);
|
||||||
if (err)
|
if (err)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
msi++;
|
msi_index++;
|
||||||
}
|
}
|
||||||
for_each_ofldrxq(s, ofldqidx) {
|
for_each_ofldrxq(s, ofldqidx) {
|
||||||
err = request_irq(adap->msix_info[msi].vec, t4_sge_intr_msix, 0,
|
err = request_irq(adap->msix_info[msi_index].vec,
|
||||||
adap->msix_info[msi].desc,
|
t4_sge_intr_msix, 0,
|
||||||
|
adap->msix_info[msi_index].desc,
|
||||||
&s->ofldrxq[ofldqidx].rspq);
|
&s->ofldrxq[ofldqidx].rspq);
|
||||||
if (err)
|
if (err)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
msi++;
|
msi_index++;
|
||||||
}
|
}
|
||||||
for_each_rdmarxq(s, rdmaqidx) {
|
for_each_rdmarxq(s, rdmaqidx) {
|
||||||
err = request_irq(adap->msix_info[msi].vec, t4_sge_intr_msix, 0,
|
err = request_irq(adap->msix_info[msi_index].vec,
|
||||||
adap->msix_info[msi].desc,
|
t4_sge_intr_msix, 0,
|
||||||
|
adap->msix_info[msi_index].desc,
|
||||||
&s->rdmarxq[rdmaqidx].rspq);
|
&s->rdmarxq[rdmaqidx].rspq);
|
||||||
if (err)
|
if (err)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
msi++;
|
msi_index++;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unwind:
|
unwind:
|
||||||
while (--rdmaqidx >= 0)
|
while (--rdmaqidx >= 0)
|
||||||
free_irq(adap->msix_info[--msi].vec,
|
free_irq(adap->msix_info[--msi_index].vec,
|
||||||
&s->rdmarxq[rdmaqidx].rspq);
|
&s->rdmarxq[rdmaqidx].rspq);
|
||||||
while (--ofldqidx >= 0)
|
while (--ofldqidx >= 0)
|
||||||
free_irq(adap->msix_info[--msi].vec,
|
free_irq(adap->msix_info[--msi_index].vec,
|
||||||
&s->ofldrxq[ofldqidx].rspq);
|
&s->ofldrxq[ofldqidx].rspq);
|
||||||
while (--ethqidx >= 0)
|
while (--ethqidx >= 0)
|
||||||
free_irq(adap->msix_info[--msi].vec, &s->ethrxq[ethqidx].rspq);
|
free_irq(adap->msix_info[--msi_index].vec,
|
||||||
|
&s->ethrxq[ethqidx].rspq);
|
||||||
free_irq(adap->msix_info[1].vec, &s->fw_evtq);
|
free_irq(adap->msix_info[1].vec, &s->fw_evtq);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_msix_queue_irqs(struct adapter *adap)
|
static void free_msix_queue_irqs(struct adapter *adap)
|
||||||
{
|
{
|
||||||
int i, msi = 2;
|
int i, msi_index = 2;
|
||||||
struct sge *s = &adap->sge;
|
struct sge *s = &adap->sge;
|
||||||
|
|
||||||
free_irq(adap->msix_info[1].vec, &s->fw_evtq);
|
free_irq(adap->msix_info[1].vec, &s->fw_evtq);
|
||||||
for_each_ethrxq(s, i)
|
for_each_ethrxq(s, i)
|
||||||
free_irq(adap->msix_info[msi++].vec, &s->ethrxq[i].rspq);
|
free_irq(adap->msix_info[msi_index++].vec, &s->ethrxq[i].rspq);
|
||||||
for_each_ofldrxq(s, i)
|
for_each_ofldrxq(s, i)
|
||||||
free_irq(adap->msix_info[msi++].vec, &s->ofldrxq[i].rspq);
|
free_irq(adap->msix_info[msi_index++].vec, &s->ofldrxq[i].rspq);
|
||||||
for_each_rdmarxq(s, i)
|
for_each_rdmarxq(s, i)
|
||||||
free_irq(adap->msix_info[msi++].vec, &s->rdmarxq[i].rspq);
|
free_irq(adap->msix_info[msi_index++].vec, &s->rdmarxq[i].rspq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2535,9 +2542,8 @@ static int read_eq_indices(struct adapter *adap, u16 qid, u16 *pidx, u16 *cidx)
|
||||||
|
|
||||||
ret = t4_mem_win_read_len(adap, addr, (__be32 *)&indices, 8);
|
ret = t4_mem_win_read_len(adap, addr, (__be32 *)&indices, 8);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
indices = be64_to_cpu(indices);
|
*cidx = (be64_to_cpu(indices) >> 25) & 0xffff;
|
||||||
*cidx = (indices >> 25) & 0xffff;
|
*pidx = (be64_to_cpu(indices) >> 9) & 0xffff;
|
||||||
*pidx = (indices >> 9) & 0xffff;
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3634,10 +3640,10 @@ static int adap_init0_no_config(struct adapter *adapter, int reset)
|
||||||
* field selections will fit in the 36-bit budget.
|
* field selections will fit in the 36-bit budget.
|
||||||
*/
|
*/
|
||||||
if (tp_vlan_pri_map != TP_VLAN_PRI_MAP_DEFAULT) {
|
if (tp_vlan_pri_map != TP_VLAN_PRI_MAP_DEFAULT) {
|
||||||
int i, bits = 0;
|
int j, bits = 0;
|
||||||
|
|
||||||
for (i = TP_VLAN_PRI_MAP_FIRST; i <= TP_VLAN_PRI_MAP_LAST; i++)
|
for (j = TP_VLAN_PRI_MAP_FIRST; j <= TP_VLAN_PRI_MAP_LAST; j++)
|
||||||
switch (tp_vlan_pri_map & (1 << i)) {
|
switch (tp_vlan_pri_map & (1 << j)) {
|
||||||
case 0:
|
case 0:
|
||||||
/* compressed filter field not enabled */
|
/* compressed filter field not enabled */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -380,9 +380,11 @@ static int t4_mem_win_rw(struct adapter *adap, u32 addr, __be32 *data, int dir)
|
||||||
/* Collecting data 4 bytes at a time upto MEMWIN0_APERTURE */
|
/* Collecting data 4 bytes at a time upto MEMWIN0_APERTURE */
|
||||||
for (i = 0; i < MEMWIN0_APERTURE; i = i+0x4) {
|
for (i = 0; i < MEMWIN0_APERTURE; i = i+0x4) {
|
||||||
if (dir)
|
if (dir)
|
||||||
*data++ = t4_read_reg(adap, (MEMWIN0_BASE + i));
|
*data++ = (__force __be32) t4_read_reg(adap,
|
||||||
|
(MEMWIN0_BASE + i));
|
||||||
else
|
else
|
||||||
t4_write_reg(adap, (MEMWIN0_BASE + i), *data++);
|
t4_write_reg(adap, (MEMWIN0_BASE + i),
|
||||||
|
(__force u32) *data++);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -417,7 +419,7 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len,
|
||||||
if ((addr & 0x3) || (len & 0x3))
|
if ((addr & 0x3) || (len & 0x3))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
data = vmalloc(MEMWIN0_APERTURE/sizeof(__be32));
|
data = vmalloc(MEMWIN0_APERTURE);
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -744,7 +746,7 @@ static int t4_read_flash(struct adapter *adapter, unsigned int addr,
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (byte_oriented)
|
if (byte_oriented)
|
||||||
*data = htonl(*data);
|
*data = (__force __u32) (htonl(*data));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -992,7 +994,7 @@ int t4_load_fw(struct adapter *adap, const u8 *fw_data, unsigned int size)
|
||||||
int ret, addr;
|
int ret, addr;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
u8 first_page[SF_PAGE_SIZE];
|
u8 first_page[SF_PAGE_SIZE];
|
||||||
const u32 *p = (const u32 *)fw_data;
|
const __be32 *p = (const __be32 *)fw_data;
|
||||||
const struct fw_hdr *hdr = (const struct fw_hdr *)fw_data;
|
const struct fw_hdr *hdr = (const struct fw_hdr *)fw_data;
|
||||||
unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec;
|
unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec;
|
||||||
unsigned int fw_img_start = adap->params.sf_fw_start;
|
unsigned int fw_img_start = adap->params.sf_fw_start;
|
||||||
|
@ -2315,7 +2317,8 @@ int t4_mem_win_read_len(struct adapter *adap, u32 addr, __be32 *data, int len)
|
||||||
t4_read_reg(adap, PCIE_MEM_ACCESS_OFFSET);
|
t4_read_reg(adap, PCIE_MEM_ACCESS_OFFSET);
|
||||||
|
|
||||||
for (i = 0; i < len; i += 4)
|
for (i = 0; i < len; i += 4)
|
||||||
*data++ = t4_read_reg(adap, (MEMWIN0_BASE + off + i));
|
*data++ = (__force __be32) t4_read_reg(adap,
|
||||||
|
(MEMWIN0_BASE + off + i));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,13 +446,17 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
|
||||||
/* Allocate Tx/Rx descriptor memory */
|
/* Allocate Tx/Rx descriptor memory */
|
||||||
db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) *
|
db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) *
|
||||||
DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr);
|
DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr);
|
||||||
if (!db->desc_pool_ptr)
|
if (!db->desc_pool_ptr) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_out_res;
|
goto err_out_res;
|
||||||
|
}
|
||||||
|
|
||||||
db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC *
|
db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC *
|
||||||
TX_DESC_CNT + 4, &db->buf_pool_dma_ptr);
|
TX_DESC_CNT + 4, &db->buf_pool_dma_ptr);
|
||||||
if (!db->buf_pool_ptr)
|
if (!db->buf_pool_ptr) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_out_free_desc;
|
goto err_out_free_desc;
|
||||||
|
}
|
||||||
|
|
||||||
db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr;
|
db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr;
|
||||||
db->first_tx_desc_dma = db->desc_pool_dma_ptr;
|
db->first_tx_desc_dma = db->desc_pool_dma_ptr;
|
||||||
|
@ -462,8 +466,10 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
|
||||||
db->chip_id = ent->driver_data;
|
db->chip_id = ent->driver_data;
|
||||||
/* IO type range. */
|
/* IO type range. */
|
||||||
db->ioaddr = pci_iomap(pdev, 0, 0);
|
db->ioaddr = pci_iomap(pdev, 0, 0);
|
||||||
if (!db->ioaddr)
|
if (!db->ioaddr) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_out_free_buf;
|
goto err_out_free_buf;
|
||||||
|
}
|
||||||
|
|
||||||
db->chip_revision = pdev->revision;
|
db->chip_revision = pdev->revision;
|
||||||
db->wol_mode = 0;
|
db->wol_mode = 0;
|
||||||
|
|
|
@ -2129,8 +2129,11 @@ void be_detect_error(struct be_adapter *adapter)
|
||||||
ue_hi = (ue_hi & ~ue_hi_mask);
|
ue_hi = (ue_hi & ~ue_hi_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ue_lo || ue_hi ||
|
/* On certain platforms BE hardware can indicate spurious UEs.
|
||||||
sliport_status & SLIPORT_STATUS_ERR_MASK) {
|
* Allow the h/w to stop working completely in case of a real UE.
|
||||||
|
* Hence not setting the hw_error for UE detection.
|
||||||
|
*/
|
||||||
|
if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
|
||||||
adapter->hw_error = true;
|
adapter->hw_error = true;
|
||||||
dev_err(&adapter->pdev->dev,
|
dev_err(&adapter->pdev->dev,
|
||||||
"Error detected in the card\n");
|
"Error detected in the card\n");
|
||||||
|
|
|
@ -1765,7 +1765,6 @@ static void free_skb_resources(struct gfar_private *priv)
|
||||||
sizeof(struct rxbd8) * priv->total_rx_ring_size,
|
sizeof(struct rxbd8) * priv->total_rx_ring_size,
|
||||||
priv->tx_queue[0]->tx_bd_base,
|
priv->tx_queue[0]->tx_bd_base,
|
||||||
priv->tx_queue[0]->tx_bd_dma_base);
|
priv->tx_queue[0]->tx_bd_dma_base);
|
||||||
skb_queue_purge(&priv->rx_recycle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfar_start(struct net_device *dev)
|
void gfar_start(struct net_device *dev)
|
||||||
|
@ -1943,8 +1942,6 @@ static int gfar_enet_open(struct net_device *dev)
|
||||||
|
|
||||||
enable_napi(priv);
|
enable_napi(priv);
|
||||||
|
|
||||||
skb_queue_head_init(&priv->rx_recycle);
|
|
||||||
|
|
||||||
/* Initialize a bunch of registers */
|
/* Initialize a bunch of registers */
|
||||||
init_registers(dev);
|
init_registers(dev);
|
||||||
|
|
||||||
|
@ -2533,16 +2530,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
|
||||||
|
|
||||||
bytes_sent += skb->len;
|
bytes_sent += skb->len;
|
||||||
|
|
||||||
/* If there's room in the queue (limit it to rx_buffer_size)
|
dev_kfree_skb_any(skb);
|
||||||
* we add this skb back into the pool, if it's the right size
|
|
||||||
*/
|
|
||||||
if (skb_queue_len(&priv->rx_recycle) < rx_queue->rx_ring_size &&
|
|
||||||
skb_recycle_check(skb, priv->rx_buffer_size +
|
|
||||||
RXBUF_ALIGNMENT)) {
|
|
||||||
gfar_align_skb(skb);
|
|
||||||
skb_queue_head(&priv->rx_recycle, skb);
|
|
||||||
} else
|
|
||||||
dev_kfree_skb_any(skb);
|
|
||||||
|
|
||||||
tx_queue->tx_skbuff[skb_dirtytx] = NULL;
|
tx_queue->tx_skbuff[skb_dirtytx] = NULL;
|
||||||
|
|
||||||
|
@ -2608,7 +2596,7 @@ static void gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
|
||||||
static struct sk_buff *gfar_alloc_skb(struct net_device *dev)
|
static struct sk_buff *gfar_alloc_skb(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct gfar_private *priv = netdev_priv(dev);
|
struct gfar_private *priv = netdev_priv(dev);
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb;
|
||||||
|
|
||||||
skb = netdev_alloc_skb(dev, priv->rx_buffer_size + RXBUF_ALIGNMENT);
|
skb = netdev_alloc_skb(dev, priv->rx_buffer_size + RXBUF_ALIGNMENT);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
|
@ -2621,14 +2609,7 @@ static struct sk_buff *gfar_alloc_skb(struct net_device *dev)
|
||||||
|
|
||||||
struct sk_buff *gfar_new_skb(struct net_device *dev)
|
struct sk_buff *gfar_new_skb(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct gfar_private *priv = netdev_priv(dev);
|
return gfar_alloc_skb(dev);
|
||||||
struct sk_buff *skb = NULL;
|
|
||||||
|
|
||||||
skb = skb_dequeue(&priv->rx_recycle);
|
|
||||||
if (!skb)
|
|
||||||
skb = gfar_alloc_skb(dev);
|
|
||||||
|
|
||||||
return skb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void count_errors(unsigned short status, struct net_device *dev)
|
static inline void count_errors(unsigned short status, struct net_device *dev)
|
||||||
|
@ -2787,7 +2768,7 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
|
||||||
if (unlikely(!newskb))
|
if (unlikely(!newskb))
|
||||||
newskb = skb;
|
newskb = skb;
|
||||||
else if (skb)
|
else if (skb)
|
||||||
skb_queue_head(&priv->rx_recycle, skb);
|
dev_kfree_skb(skb);
|
||||||
} else {
|
} else {
|
||||||
/* Increment the number of packets */
|
/* Increment the number of packets */
|
||||||
rx_queue->stats.rx_packets++;
|
rx_queue->stats.rx_packets++;
|
||||||
|
|
|
@ -1080,8 +1080,6 @@ struct gfar_private {
|
||||||
|
|
||||||
u32 cur_filer_idx;
|
u32 cur_filer_idx;
|
||||||
|
|
||||||
struct sk_buff_head rx_recycle;
|
|
||||||
|
|
||||||
/* RX queue filer rule set*/
|
/* RX queue filer rule set*/
|
||||||
struct ethtool_rx_list rx_list;
|
struct ethtool_rx_list rx_list;
|
||||||
struct mutex rx_queue_access;
|
struct mutex rx_queue_access;
|
||||||
|
|
|
@ -209,14 +209,12 @@ static struct list_head *dequeue(struct list_head *lh)
|
||||||
static struct sk_buff *get_new_skb(struct ucc_geth_private *ugeth,
|
static struct sk_buff *get_new_skb(struct ucc_geth_private *ugeth,
|
||||||
u8 __iomem *bd)
|
u8 __iomem *bd)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb;
|
||||||
|
|
||||||
skb = __skb_dequeue(&ugeth->rx_recycle);
|
skb = netdev_alloc_skb(ugeth->ndev,
|
||||||
|
ugeth->ug_info->uf_info.max_rx_buf_length +
|
||||||
|
UCC_GETH_RX_DATA_BUF_ALIGNMENT);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
skb = netdev_alloc_skb(ugeth->ndev,
|
|
||||||
ugeth->ug_info->uf_info.max_rx_buf_length +
|
|
||||||
UCC_GETH_RX_DATA_BUF_ALIGNMENT);
|
|
||||||
if (skb == NULL)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* We need the data buffer to be aligned properly. We will reserve
|
/* We need the data buffer to be aligned properly. We will reserve
|
||||||
|
@ -2020,8 +2018,6 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
|
||||||
iounmap(ugeth->ug_regs);
|
iounmap(ugeth->ug_regs);
|
||||||
ugeth->ug_regs = NULL;
|
ugeth->ug_regs = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_queue_purge(&ugeth->rx_recycle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ucc_geth_set_multi(struct net_device *dev)
|
static void ucc_geth_set_multi(struct net_device *dev)
|
||||||
|
@ -2230,8 +2226,6 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_queue_head_init(&ugeth->rx_recycle);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3274,12 +3268,7 @@ static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
|
||||||
if (netif_msg_rx_err(ugeth))
|
if (netif_msg_rx_err(ugeth))
|
||||||
ugeth_err("%s, %d: ERROR!!! skb - 0x%08x",
|
ugeth_err("%s, %d: ERROR!!! skb - 0x%08x",
|
||||||
__func__, __LINE__, (u32) skb);
|
__func__, __LINE__, (u32) skb);
|
||||||
if (skb) {
|
dev_kfree_skb(skb);
|
||||||
skb->data = skb->head + NET_SKB_PAD;
|
|
||||||
skb->len = 0;
|
|
||||||
skb_reset_tail_pointer(skb);
|
|
||||||
__skb_queue_head(&ugeth->rx_recycle, skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
ugeth->rx_skbuff[rxQ][ugeth->skb_currx[rxQ]] = NULL;
|
ugeth->rx_skbuff[rxQ][ugeth->skb_currx[rxQ]] = NULL;
|
||||||
dev->stats.rx_dropped++;
|
dev->stats.rx_dropped++;
|
||||||
|
@ -3349,13 +3338,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
|
||||||
|
|
||||||
dev->stats.tx_packets++;
|
dev->stats.tx_packets++;
|
||||||
|
|
||||||
if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN &&
|
dev_kfree_skb(skb);
|
||||||
skb_recycle_check(skb,
|
|
||||||
ugeth->ug_info->uf_info.max_rx_buf_length +
|
|
||||||
UCC_GETH_RX_DATA_BUF_ALIGNMENT))
|
|
||||||
__skb_queue_head(&ugeth->rx_recycle, skb);
|
|
||||||
else
|
|
||||||
dev_kfree_skb(skb);
|
|
||||||
|
|
||||||
ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] = NULL;
|
ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] = NULL;
|
||||||
ugeth->skb_dirtytx[txQ] =
|
ugeth->skb_dirtytx[txQ] =
|
||||||
|
|
|
@ -1214,8 +1214,6 @@ struct ucc_geth_private {
|
||||||
/* index of the first skb which hasn't been transmitted yet. */
|
/* index of the first skb which hasn't been transmitted yet. */
|
||||||
u16 skb_dirtytx[NUM_TX_QUEUES];
|
u16 skb_dirtytx[NUM_TX_QUEUES];
|
||||||
|
|
||||||
struct sk_buff_head rx_recycle;
|
|
||||||
|
|
||||||
struct ugeth_mii_info *mii_info;
|
struct ugeth_mii_info *mii_info;
|
||||||
struct phy_device *phydev;
|
struct phy_device *phydev;
|
||||||
phy_interface_t phy_interface;
|
phy_interface_t phy_interface;
|
||||||
|
|
|
@ -412,6 +412,8 @@ enum e1e_registers {
|
||||||
#define E1000_DEV_ID_PCH2_LV_V 0x1503
|
#define E1000_DEV_ID_PCH2_LV_V 0x1503
|
||||||
#define E1000_DEV_ID_PCH_LPT_I217_LM 0x153A
|
#define E1000_DEV_ID_PCH_LPT_I217_LM 0x153A
|
||||||
#define E1000_DEV_ID_PCH_LPT_I217_V 0x153B
|
#define E1000_DEV_ID_PCH_LPT_I217_V 0x153B
|
||||||
|
#define E1000_DEV_ID_PCH_LPTLP_I218_LM 0x155A
|
||||||
|
#define E1000_DEV_ID_PCH_LPTLP_I218_V 0x1559
|
||||||
|
|
||||||
#define E1000_REVISION_4 4
|
#define E1000_REVISION_4 4
|
||||||
|
|
||||||
|
|
|
@ -6558,6 +6558,8 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
|
||||||
|
|
||||||
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_LM), board_pch_lpt },
|
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_LM), board_pch_lpt },
|
||||||
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_V), board_pch_lpt },
|
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_V), board_pch_lpt },
|
||||||
|
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_LM), board_pch_lpt },
|
||||||
|
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_V), board_pch_lpt },
|
||||||
|
|
||||||
{ 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
|
{ 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
|
||||||
};
|
};
|
||||||
|
|
|
@ -410,7 +410,7 @@ static inline u16 ixgbe_desc_unused(struct ixgbe_ring *ring)
|
||||||
#define IXGBE_TX_CTXTDESC(R, i) \
|
#define IXGBE_TX_CTXTDESC(R, i) \
|
||||||
(&(((struct ixgbe_adv_tx_context_desc *)((R)->desc))[i]))
|
(&(((struct ixgbe_adv_tx_context_desc *)((R)->desc))[i]))
|
||||||
|
|
||||||
#define IXGBE_MAX_JUMBO_FRAME_SIZE 16128
|
#define IXGBE_MAX_JUMBO_FRAME_SIZE 9728 /* Maximum Supported Size 9.5KB */
|
||||||
#ifdef IXGBE_FCOE
|
#ifdef IXGBE_FCOE
|
||||||
/* Use 3K as the baby jumbo frame size for FCoE */
|
/* Use 3K as the baby jumbo frame size for FCoE */
|
||||||
#define IXGBE_FCOE_JUMBO_FRAME_SIZE 3072
|
#define IXGBE_FCOE_JUMBO_FRAME_SIZE 3072
|
||||||
|
|
|
@ -175,7 +175,7 @@ struct ixgbevf_q_vector {
|
||||||
#define IXGBEVF_TX_CTXTDESC(R, i) \
|
#define IXGBEVF_TX_CTXTDESC(R, i) \
|
||||||
(&(((struct ixgbe_adv_tx_context_desc *)((R)->desc))[i]))
|
(&(((struct ixgbe_adv_tx_context_desc *)((R)->desc))[i]))
|
||||||
|
|
||||||
#define IXGBE_MAX_JUMBO_FRAME_SIZE 16128
|
#define IXGBE_MAX_JUMBO_FRAME_SIZE 9728 /* Maximum Supported Size 9.5KB */
|
||||||
|
|
||||||
#define OTHER_VECTOR 1
|
#define OTHER_VECTOR 1
|
||||||
#define NON_Q_VECTORS (OTHER_VECTOR)
|
#define NON_Q_VECTORS (OTHER_VECTOR)
|
||||||
|
|
|
@ -1747,6 +1747,7 @@ static int ixgbevf_alloc_queues(struct ixgbevf_adapter *adapter)
|
||||||
**/
|
**/
|
||||||
static int ixgbevf_set_interrupt_capability(struct ixgbevf_adapter *adapter)
|
static int ixgbevf_set_interrupt_capability(struct ixgbevf_adapter *adapter)
|
||||||
{
|
{
|
||||||
|
struct net_device *netdev = adapter->netdev;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int vector, v_budget;
|
int vector, v_budget;
|
||||||
|
|
||||||
|
@ -1775,6 +1776,12 @@ static int ixgbevf_set_interrupt_capability(struct ixgbevf_adapter *adapter)
|
||||||
|
|
||||||
ixgbevf_acquire_msix_vectors(adapter, v_budget);
|
ixgbevf_acquire_msix_vectors(adapter, v_budget);
|
||||||
|
|
||||||
|
err = netif_set_real_num_tx_queues(netdev, adapter->num_tx_queues);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
err = netif_set_real_num_rx_queues(netdev, adapter->num_rx_queues);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,7 +412,6 @@ struct mv643xx_eth_private {
|
||||||
u8 work_rx_refill;
|
u8 work_rx_refill;
|
||||||
|
|
||||||
int skb_size;
|
int skb_size;
|
||||||
struct sk_buff_head rx_recycle;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RX state.
|
* RX state.
|
||||||
|
@ -673,9 +672,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget)
|
||||||
struct rx_desc *rx_desc;
|
struct rx_desc *rx_desc;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
skb = __skb_dequeue(&mp->rx_recycle);
|
skb = netdev_alloc_skb(mp->dev, mp->skb_size);
|
||||||
if (skb == NULL)
|
|
||||||
skb = netdev_alloc_skb(mp->dev, mp->skb_size);
|
|
||||||
|
|
||||||
if (skb == NULL) {
|
if (skb == NULL) {
|
||||||
mp->oom = 1;
|
mp->oom = 1;
|
||||||
|
@ -989,14 +986,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
|
||||||
desc->byte_cnt, DMA_TO_DEVICE);
|
desc->byte_cnt, DMA_TO_DEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skb != NULL) {
|
dev_kfree_skb(skb);
|
||||||
if (skb_queue_len(&mp->rx_recycle) <
|
|
||||||
mp->rx_ring_size &&
|
|
||||||
skb_recycle_check(skb, mp->skb_size))
|
|
||||||
__skb_queue_head(&mp->rx_recycle, skb);
|
|
||||||
else
|
|
||||||
dev_kfree_skb(skb);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__netif_tx_unlock(nq);
|
__netif_tx_unlock(nq);
|
||||||
|
@ -2349,8 +2339,6 @@ static int mv643xx_eth_open(struct net_device *dev)
|
||||||
|
|
||||||
napi_enable(&mp->napi);
|
napi_enable(&mp->napi);
|
||||||
|
|
||||||
skb_queue_head_init(&mp->rx_recycle);
|
|
||||||
|
|
||||||
mp->int_mask = INT_EXT;
|
mp->int_mask = INT_EXT;
|
||||||
|
|
||||||
for (i = 0; i < mp->rxq_count; i++) {
|
for (i = 0; i < mp->rxq_count; i++) {
|
||||||
|
@ -2445,8 +2433,6 @@ static int mv643xx_eth_stop(struct net_device *dev)
|
||||||
mib_counters_update(mp);
|
mib_counters_update(mp);
|
||||||
del_timer_sync(&mp->mib_counters_timer);
|
del_timer_sync(&mp->mib_counters_timer);
|
||||||
|
|
||||||
skb_queue_purge(&mp->rx_recycle);
|
|
||||||
|
|
||||||
for (i = 0; i < mp->rxq_count; i++)
|
for (i = 0; i < mp->rxq_count; i++)
|
||||||
rxq_deinit(mp->rxq + i);
|
rxq_deinit(mp->rxq + i);
|
||||||
for (i = 0; i < mp->txq_count; i++)
|
for (i = 0; i < mp->txq_count; i++)
|
||||||
|
|
|
@ -3189,7 +3189,7 @@ static int skge_poll(struct napi_struct *napi, int to_do)
|
||||||
if (work_done < to_do) {
|
if (work_done < to_do) {
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
napi_gro_flush(napi);
|
napi_gro_flush(napi, false);
|
||||||
spin_lock_irqsave(&hw->hw_lock, flags);
|
spin_lock_irqsave(&hw->hw_lock, flags);
|
||||||
__napi_complete(napi);
|
__napi_complete(napi);
|
||||||
hw->intr_mask |= napimask[skge->port];
|
hw->intr_mask |= napimask[skge->port];
|
||||||
|
@ -3945,8 +3945,10 @@ static int __devinit skge_probe(struct pci_dev *pdev,
|
||||||
skge_board_name(hw), hw->chip_rev);
|
skge_board_name(hw), hw->chip_rev);
|
||||||
|
|
||||||
dev = skge_devinit(hw, 0, using_dac);
|
dev = skge_devinit(hw, 0, using_dac);
|
||||||
if (!dev)
|
if (!dev) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_out_led_off;
|
goto err_out_led_off;
|
||||||
|
}
|
||||||
|
|
||||||
/* Some motherboards are broken and has zero in ROM. */
|
/* Some motherboards are broken and has zero in ROM. */
|
||||||
if (!is_valid_ether_addr(dev->dev_addr))
|
if (!is_valid_ether_addr(dev->dev_addr))
|
||||||
|
@ -4153,6 +4155,13 @@ static struct dmi_system_id skge_32bit_dma_boards[] = {
|
||||||
DMI_MATCH(DMI_BOARD_NAME, "nForce"),
|
DMI_MATCH(DMI_BOARD_NAME, "nForce"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.ident = "ASUS P5NSLI",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
|
||||||
|
DMI_MATCH(DMI_BOARD_NAME, "P5NSLI")
|
||||||
|
},
|
||||||
|
},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4924,6 +4924,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
|
||||||
|
|
||||||
if (~reg == 0) {
|
if (~reg == 0) {
|
||||||
dev_err(&pdev->dev, "PCI configuration read error\n");
|
dev_err(&pdev->dev, "PCI configuration read error\n");
|
||||||
|
err = -EIO;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4993,8 +4994,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
|
||||||
hw->st_size = hw->ports * roundup_pow_of_two(3*RX_MAX_PENDING + TX_MAX_PENDING);
|
hw->st_size = hw->ports * roundup_pow_of_two(3*RX_MAX_PENDING + TX_MAX_PENDING);
|
||||||
hw->st_le = pci_alloc_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
|
hw->st_le = pci_alloc_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
|
||||||
&hw->st_dma);
|
&hw->st_dma);
|
||||||
if (!hw->st_le)
|
if (!hw->st_le) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_out_reset;
|
goto err_out_reset;
|
||||||
|
}
|
||||||
|
|
||||||
dev_info(&pdev->dev, "Yukon-2 %s chip revision %d\n",
|
dev_info(&pdev->dev, "Yukon-2 %s chip revision %d\n",
|
||||||
sky2_name(hw->chip_id, buf1, sizeof(buf1)), hw->chip_rev);
|
sky2_name(hw->chip_id, buf1, sizeof(buf1)), hw->chip_rev);
|
||||||
|
|
|
@ -947,8 +947,8 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
|
||||||
i = register_netdev(dev);
|
i = register_netdev(dev);
|
||||||
if (i)
|
if (i)
|
||||||
goto err_register_netdev;
|
goto err_register_netdev;
|
||||||
|
i = NATSEMI_CREATE_FILE(pdev, dspcfg_workaround);
|
||||||
if (NATSEMI_CREATE_FILE(pdev, dspcfg_workaround))
|
if (i)
|
||||||
goto err_create_file;
|
goto err_create_file;
|
||||||
|
|
||||||
if (netif_msg_drv(np)) {
|
if (netif_msg_drv(np)) {
|
||||||
|
|
|
@ -205,6 +205,7 @@ static int __init sonic_probe1(struct net_device *dev)
|
||||||
if (lp->descriptors == NULL) {
|
if (lp->descriptors == NULL) {
|
||||||
printk(KERN_ERR "%s: couldn't alloc DMA memory for "
|
printk(KERN_ERR "%s: couldn't alloc DMA memory for "
|
||||||
" descriptors.\n", dev_name(lp->device));
|
" descriptors.\n", dev_name(lp->device));
|
||||||
|
err = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@ if PCH_GBE
|
||||||
config PCH_PTP
|
config PCH_PTP
|
||||||
bool "PCH PTP clock support"
|
bool "PCH PTP clock support"
|
||||||
default n
|
default n
|
||||||
|
depends on EXPERIMENTAL
|
||||||
|
select PPS
|
||||||
|
select PTP_1588_CLOCK
|
||||||
select PTP_1588_CLOCK_PCH
|
select PTP_1588_CLOCK_PCH
|
||||||
---help---
|
---help---
|
||||||
Say Y here if you want to use Precision Time Protocol (PTP) in the
|
Say Y here if you want to use Precision Time Protocol (PTP) in the
|
||||||
|
|
|
@ -1601,7 +1601,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
adapter->netdev = netdev;
|
adapter->netdev = netdev;
|
||||||
adapter->pdev = pdev;
|
adapter->pdev = pdev;
|
||||||
|
|
||||||
if (qlcnic_alloc_adapter_resources(adapter))
|
err = qlcnic_alloc_adapter_resources(adapter);
|
||||||
|
if (err)
|
||||||
goto err_out_free_netdev;
|
goto err_out_free_netdev;
|
||||||
|
|
||||||
adapter->dev_rst_time = jiffies;
|
adapter->dev_rst_time = jiffies;
|
||||||
|
|
|
@ -563,7 +563,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
|
||||||
if (cpr16(IntrStatus) & cp_rx_intr_mask)
|
if (cpr16(IntrStatus) & cp_rx_intr_mask)
|
||||||
goto rx_status_loop;
|
goto rx_status_loop;
|
||||||
|
|
||||||
napi_gro_flush(napi);
|
napi_gro_flush(napi, false);
|
||||||
spin_lock_irqsave(&cp->lock, flags);
|
spin_lock_irqsave(&cp->lock, flags);
|
||||||
__napi_complete(napi);
|
__napi_complete(napi);
|
||||||
cpw16_f(IntrMask, cp_intr_mask);
|
cpw16_f(IntrMask, cp_intr_mask);
|
||||||
|
|
|
@ -2438,6 +2438,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
|
||||||
rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||||
if (!rtsu) {
|
if (!rtsu) {
|
||||||
dev_err(&pdev->dev, "Not found TSU resource\n");
|
dev_err(&pdev->dev, "Not found TSU resource\n");
|
||||||
|
ret = -ENODEV;
|
||||||
goto out_release;
|
goto out_release;
|
||||||
}
|
}
|
||||||
mdp->tsu_addr = ioremap(rtsu->start,
|
mdp->tsu_addr = ioremap(rtsu->start,
|
||||||
|
|
|
@ -640,8 +640,7 @@ static void efx_ptp_drop_time_expired_events(struct efx_nic *efx)
|
||||||
evt = list_entry(cursor, struct efx_ptp_event_rx,
|
evt = list_entry(cursor, struct efx_ptp_event_rx,
|
||||||
link);
|
link);
|
||||||
if (time_after(jiffies, evt->expiry)) {
|
if (time_after(jiffies, evt->expiry)) {
|
||||||
list_del(&evt->link);
|
list_move(&evt->link, &ptp->evt_free_list);
|
||||||
list_add(&evt->link, &ptp->evt_free_list);
|
|
||||||
netif_warn(efx, hw, efx->net_dev,
|
netif_warn(efx, hw, efx->net_dev,
|
||||||
"PTP rx event dropped\n");
|
"PTP rx event dropped\n");
|
||||||
}
|
}
|
||||||
|
@ -684,8 +683,7 @@ static enum ptp_packet_state efx_ptp_match_rx(struct efx_nic *efx,
|
||||||
|
|
||||||
match->state = PTP_PACKET_STATE_MATCHED;
|
match->state = PTP_PACKET_STATE_MATCHED;
|
||||||
rc = PTP_PACKET_STATE_MATCHED;
|
rc = PTP_PACKET_STATE_MATCHED;
|
||||||
list_del(&evt->link);
|
list_move(&evt->link, &ptp->evt_free_list);
|
||||||
list_add(&evt->link, &ptp->evt_free_list);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -820,8 +818,7 @@ static int efx_ptp_stop(struct efx_nic *efx)
|
||||||
/* Drop any pending receive events */
|
/* Drop any pending receive events */
|
||||||
spin_lock_bh(&efx->ptp_data->evt_lock);
|
spin_lock_bh(&efx->ptp_data->evt_lock);
|
||||||
list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) {
|
list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) {
|
||||||
list_del(cursor);
|
list_move(cursor, &efx->ptp_data->evt_free_list);
|
||||||
list_add(cursor, &efx->ptp_data->evt_free_list);
|
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&efx->ptp_data->evt_lock);
|
spin_unlock_bh(&efx->ptp_data->evt_lock);
|
||||||
|
|
||||||
|
|
|
@ -478,8 +478,10 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
|
||||||
|
|
||||||
/* IO region. */
|
/* IO region. */
|
||||||
ioaddr = pci_iomap(pci_dev, 0, 0);
|
ioaddr = pci_iomap(pci_dev, 0, 0);
|
||||||
if (!ioaddr)
|
if (!ioaddr) {
|
||||||
|
ret = -ENOMEM;
|
||||||
goto err_out_cleardev;
|
goto err_out_cleardev;
|
||||||
|
}
|
||||||
|
|
||||||
sis_priv = netdev_priv(net_dev);
|
sis_priv = netdev_priv(net_dev);
|
||||||
sis_priv->ioaddr = ioaddr;
|
sis_priv->ioaddr = ioaddr;
|
||||||
|
|
|
@ -50,7 +50,6 @@ struct stmmac_priv {
|
||||||
unsigned int dirty_rx;
|
unsigned int dirty_rx;
|
||||||
struct sk_buff **rx_skbuff;
|
struct sk_buff **rx_skbuff;
|
||||||
dma_addr_t *rx_skbuff_dma;
|
dma_addr_t *rx_skbuff_dma;
|
||||||
struct sk_buff_head rx_recycle;
|
|
||||||
|
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
dma_addr_t dma_rx_phy;
|
dma_addr_t dma_rx_phy;
|
||||||
|
|
|
@ -747,18 +747,7 @@ static void stmmac_tx(struct stmmac_priv *priv)
|
||||||
priv->hw->ring->clean_desc3(p);
|
priv->hw->ring->clean_desc3(p);
|
||||||
|
|
||||||
if (likely(skb != NULL)) {
|
if (likely(skb != NULL)) {
|
||||||
/*
|
dev_kfree_skb(skb);
|
||||||
* If there's room in the queue (limit it to size)
|
|
||||||
* we add this skb back into the pool,
|
|
||||||
* if it's the right size.
|
|
||||||
*/
|
|
||||||
if ((skb_queue_len(&priv->rx_recycle) <
|
|
||||||
priv->dma_rx_size) &&
|
|
||||||
skb_recycle_check(skb, priv->dma_buf_sz))
|
|
||||||
__skb_queue_head(&priv->rx_recycle, skb);
|
|
||||||
else
|
|
||||||
dev_kfree_skb(skb);
|
|
||||||
|
|
||||||
priv->tx_skbuff[entry] = NULL;
|
priv->tx_skbuff[entry] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1169,7 +1158,6 @@ static int stmmac_open(struct net_device *dev)
|
||||||
priv->eee_enabled = stmmac_eee_init(priv);
|
priv->eee_enabled = stmmac_eee_init(priv);
|
||||||
|
|
||||||
napi_enable(&priv->napi);
|
napi_enable(&priv->napi);
|
||||||
skb_queue_head_init(&priv->rx_recycle);
|
|
||||||
netif_start_queue(dev);
|
netif_start_queue(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1222,7 +1210,6 @@ static int stmmac_release(struct net_device *dev)
|
||||||
kfree(priv->tm);
|
kfree(priv->tm);
|
||||||
#endif
|
#endif
|
||||||
napi_disable(&priv->napi);
|
napi_disable(&priv->napi);
|
||||||
skb_queue_purge(&priv->rx_recycle);
|
|
||||||
|
|
||||||
/* Free the IRQ lines */
|
/* Free the IRQ lines */
|
||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
|
@ -1388,10 +1375,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv)
|
||||||
if (likely(priv->rx_skbuff[entry] == NULL)) {
|
if (likely(priv->rx_skbuff[entry] == NULL)) {
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
|
||||||
skb = __skb_dequeue(&priv->rx_recycle);
|
skb = netdev_alloc_skb_ip_align(priv->dev, bfsize);
|
||||||
if (skb == NULL)
|
|
||||||
skb = netdev_alloc_skb_ip_align(priv->dev,
|
|
||||||
bfsize);
|
|
||||||
|
|
||||||
if (unlikely(skb == NULL))
|
if (unlikely(skb == NULL))
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -9788,6 +9788,7 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev,
|
||||||
|
|
||||||
if (!pci_is_pcie(pdev)) {
|
if (!pci_is_pcie(pdev)) {
|
||||||
dev_err(&pdev->dev, "Cannot find PCI Express capability, aborting\n");
|
dev_err(&pdev->dev, "Cannot find PCI Express capability, aborting\n");
|
||||||
|
err = -ENODEV;
|
||||||
goto err_out_free_res;
|
goto err_out_free_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2963,7 +2963,8 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
|
||||||
goto err_out_iounmap;
|
goto err_out_iounmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gem_get_device_address(gp))
|
err = gem_get_device_address(gp);
|
||||||
|
if (err)
|
||||||
goto err_out_free_consistent;
|
goto err_out_free_consistent;
|
||||||
|
|
||||||
dev->netdev_ops = &gem_netdev_ops;
|
dev->netdev_ops = &gem_netdev_ops;
|
||||||
|
|
|
@ -459,8 +459,10 @@ static int irtty_open(struct tty_struct *tty)
|
||||||
|
|
||||||
/* allocate private device info block */
|
/* allocate private device info block */
|
||||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||||
if (!priv)
|
if (!priv) {
|
||||||
|
ret = -ENOMEM;
|
||||||
goto out_put;
|
goto out_put;
|
||||||
|
}
|
||||||
|
|
||||||
priv->magic = IRTTY_MAGIC;
|
priv->magic = IRTTY_MAGIC;
|
||||||
priv->tty = tty;
|
priv->tty = tty;
|
||||||
|
|
|
@ -920,8 +920,10 @@ static int mcs_probe(struct usb_interface *intf,
|
||||||
|
|
||||||
ndev->netdev_ops = &mcs_netdev_ops;
|
ndev->netdev_ops = &mcs_netdev_ops;
|
||||||
|
|
||||||
if (!intf->cur_altsetting)
|
if (!intf->cur_altsetting) {
|
||||||
|
ret = -ENOMEM;
|
||||||
goto error2;
|
goto error2;
|
||||||
|
}
|
||||||
|
|
||||||
ret = mcs_find_endpoints(mcs, intf->cur_altsetting->endpoint,
|
ret = mcs_find_endpoints(mcs, intf->cur_altsetting->endpoint,
|
||||||
intf->cur_altsetting->desc.bNumEndpoints);
|
intf->cur_altsetting->desc.bNumEndpoints);
|
||||||
|
|
|
@ -846,8 +846,10 @@ static int pxa_irda_probe(struct platform_device *pdev)
|
||||||
goto err_mem_2;
|
goto err_mem_2;
|
||||||
|
|
||||||
dev = alloc_irdadev(sizeof(struct pxa_irda));
|
dev = alloc_irdadev(sizeof(struct pxa_irda));
|
||||||
if (!dev)
|
if (!dev) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_mem_3;
|
goto err_mem_3;
|
||||||
|
}
|
||||||
|
|
||||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||||
si = netdev_priv(dev);
|
si = netdev_priv(dev);
|
||||||
|
|
|
@ -940,8 +940,10 @@ static int sa1100_irda_probe(struct platform_device *pdev)
|
||||||
goto err_mem_3;
|
goto err_mem_3;
|
||||||
|
|
||||||
dev = alloc_irdadev(sizeof(struct sa1100_irda));
|
dev = alloc_irdadev(sizeof(struct sa1100_irda));
|
||||||
if (!dev)
|
if (!dev) {
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_mem_4;
|
goto err_mem_4;
|
||||||
|
}
|
||||||
|
|
||||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||||
|
|
||||||
|
|
|
@ -808,8 +808,8 @@ static int __devinit sh_irda_probe(struct platform_device *pdev)
|
||||||
goto err_mem_4;
|
goto err_mem_4;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, ndev);
|
platform_set_drvdata(pdev, ndev);
|
||||||
|
err = request_irq(irq, sh_irda_irq, IRQF_DISABLED, "sh_irda", self);
|
||||||
if (request_irq(irq, sh_irda_irq, IRQF_DISABLED, "sh_irda", self)) {
|
if (err) {
|
||||||
dev_warn(&pdev->dev, "Unable to attach sh_irda interrupt\n");
|
dev_warn(&pdev->dev, "Unable to attach sh_irda interrupt\n");
|
||||||
goto err_mem_4;
|
goto err_mem_4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -741,6 +741,7 @@ static int __devinit sh_sir_probe(struct platform_device *pdev)
|
||||||
self->clk = clk_get(&pdev->dev, clk_name);
|
self->clk = clk_get(&pdev->dev, clk_name);
|
||||||
if (IS_ERR(self->clk)) {
|
if (IS_ERR(self->clk)) {
|
||||||
dev_err(&pdev->dev, "cannot get clock \"%s\"\n", clk_name);
|
dev_err(&pdev->dev, "cannot get clock \"%s\"\n", clk_name);
|
||||||
|
err = -ENODEV;
|
||||||
goto err_mem_3;
|
goto err_mem_3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -760,8 +761,8 @@ static int __devinit sh_sir_probe(struct platform_device *pdev)
|
||||||
goto err_mem_4;
|
goto err_mem_4;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, ndev);
|
platform_set_drvdata(pdev, ndev);
|
||||||
|
err = request_irq(irq, sh_sir_irq, IRQF_DISABLED, "sh_sir", self);
|
||||||
if (request_irq(irq, sh_sir_irq, IRQF_DISABLED, "sh_sir", self)) {
|
if (err) {
|
||||||
dev_warn(&pdev->dev, "Unable to attach sh_sir interrupt\n");
|
dev_warn(&pdev->dev, "Unable to attach sh_sir interrupt\n");
|
||||||
goto err_mem_4;
|
goto err_mem_4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
|
#include <linux/of_mdio.h>
|
||||||
#include <linux/netdevice.h>
|
#include <linux/netdevice.h>
|
||||||
#include <linux/etherdevice.h>
|
#include <linux/etherdevice.h>
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include <linux/igmp.h>
|
#include <linux/igmp.h>
|
||||||
#include <linux/etherdevice.h>
|
#include <linux/etherdevice.h>
|
||||||
#include <linux/if_ether.h>
|
#include <linux/if_ether.h>
|
||||||
#include <linux/version.h>
|
|
||||||
#include <linux/hash.h>
|
#include <linux/hash.h>
|
||||||
#include <net/ip.h>
|
#include <net/ip.h>
|
||||||
#include <net/icmp.h>
|
#include <net/icmp.h>
|
||||||
|
@ -1084,13 +1083,13 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
|
||||||
if (nla_put_u32(skb, IFLA_VXLAN_ID, vxlan->vni))
|
if (nla_put_u32(skb, IFLA_VXLAN_ID, vxlan->vni))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
|
||||||
if (vxlan->gaddr && nla_put_u32(skb, IFLA_VXLAN_GROUP, vxlan->gaddr))
|
if (vxlan->gaddr && nla_put_be32(skb, IFLA_VXLAN_GROUP, vxlan->gaddr))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
|
||||||
if (vxlan->link && nla_put_u32(skb, IFLA_VXLAN_LINK, vxlan->link))
|
if (vxlan->link && nla_put_u32(skb, IFLA_VXLAN_LINK, vxlan->link))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
|
||||||
if (vxlan->saddr && nla_put_u32(skb, IFLA_VXLAN_LOCAL, vxlan->saddr))
|
if (vxlan->saddr && nla_put_be32(skb, IFLA_VXLAN_LOCAL, vxlan->saddr))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
|
||||||
if (nla_put_u8(skb, IFLA_VXLAN_TTL, vxlan->ttl) ||
|
if (nla_put_u8(skb, IFLA_VXLAN_TTL, vxlan->ttl) ||
|
||||||
|
|
|
@ -597,7 +597,7 @@ fst_q_work_item(u64 * queue, int card_index)
|
||||||
* bottom half for the card. Note the limitation of 64 cards.
|
* bottom half for the card. Note the limitation of 64 cards.
|
||||||
* That ought to be enough
|
* That ought to be enough
|
||||||
*/
|
*/
|
||||||
mask = 1 << card_index;
|
mask = (u64)1 << card_index;
|
||||||
*queue |= mask;
|
*queue |= mask;
|
||||||
spin_unlock_irqrestore(&fst_work_q_lock, flags);
|
spin_unlock_irqrestore(&fst_work_q_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
header-y += caif_socket.h
|
|
||||||
header-y += if_caif.h
|
|
|
@ -80,6 +80,8 @@ static inline int is_vlan_dev(struct net_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
|
#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
|
||||||
|
#define vlan_tx_nonzero_tag_present(__skb) \
|
||||||
|
(vlan_tx_tag_present(__skb) && ((__skb)->vlan_tci & VLAN_VID_MASK))
|
||||||
#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
|
#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
|
||||||
|
|
||||||
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
|
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
|
||||||
|
@ -89,7 +91,7 @@ extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
|
||||||
extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
|
extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
|
||||||
extern u16 vlan_dev_vlan_id(const struct net_device *dev);
|
extern u16 vlan_dev_vlan_id(const struct net_device *dev);
|
||||||
|
|
||||||
extern bool vlan_do_receive(struct sk_buff **skb, bool last_handler);
|
extern bool vlan_do_receive(struct sk_buff **skb);
|
||||||
extern struct sk_buff *vlan_untag(struct sk_buff *skb);
|
extern struct sk_buff *vlan_untag(struct sk_buff *skb);
|
||||||
|
|
||||||
extern int vlan_vid_add(struct net_device *dev, unsigned short vid);
|
extern int vlan_vid_add(struct net_device *dev, unsigned short vid);
|
||||||
|
@ -120,10 +122,8 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool vlan_do_receive(struct sk_buff **skb, bool last_handler)
|
static inline bool vlan_do_receive(struct sk_buff **skb)
|
||||||
{
|
{
|
||||||
if (((*skb)->vlan_tci & VLAN_VID_MASK) && last_handler)
|
|
||||||
(*skb)->pkt_type = PACKET_OTHERHOST;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
header-y += capicmd.h
|
|
|
@ -1497,19 +1497,25 @@ struct napi_gro_cb {
|
||||||
/* This indicates where we are processing relative to skb->data. */
|
/* This indicates where we are processing relative to skb->data. */
|
||||||
int data_offset;
|
int data_offset;
|
||||||
|
|
||||||
/* This is non-zero if the packet may be of the same flow. */
|
|
||||||
int same_flow;
|
|
||||||
|
|
||||||
/* This is non-zero if the packet cannot be merged with the new skb. */
|
/* This is non-zero if the packet cannot be merged with the new skb. */
|
||||||
int flush;
|
int flush;
|
||||||
|
|
||||||
/* Number of segments aggregated. */
|
/* Number of segments aggregated. */
|
||||||
int count;
|
u16 count;
|
||||||
|
|
||||||
|
/* This is non-zero if the packet may be of the same flow. */
|
||||||
|
u8 same_flow;
|
||||||
|
|
||||||
/* Free the skb? */
|
/* Free the skb? */
|
||||||
int free;
|
u8 free;
|
||||||
#define NAPI_GRO_FREE 1
|
#define NAPI_GRO_FREE 1
|
||||||
#define NAPI_GRO_FREE_STOLEN_HEAD 2
|
#define NAPI_GRO_FREE_STOLEN_HEAD 2
|
||||||
|
|
||||||
|
/* jiffies when first packet was created/queued */
|
||||||
|
unsigned long age;
|
||||||
|
|
||||||
|
/* Used in ipv6_gro_receive() */
|
||||||
|
int proto;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
|
#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
|
||||||
|
@ -1663,7 +1669,6 @@ extern int netpoll_trap(void);
|
||||||
#endif
|
#endif
|
||||||
extern int skb_gro_receive(struct sk_buff **head,
|
extern int skb_gro_receive(struct sk_buff **head,
|
||||||
struct sk_buff *skb);
|
struct sk_buff *skb);
|
||||||
extern void skb_gro_reset_offset(struct sk_buff *skb);
|
|
||||||
|
|
||||||
static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
|
static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
|
@ -2157,7 +2162,7 @@ extern gro_result_t dev_gro_receive(struct napi_struct *napi,
|
||||||
extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
|
extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
|
||||||
extern gro_result_t napi_gro_receive(struct napi_struct *napi,
|
extern gro_result_t napi_gro_receive(struct napi_struct *napi,
|
||||||
struct sk_buff *skb);
|
struct sk_buff *skb);
|
||||||
extern void napi_gro_flush(struct napi_struct *napi);
|
extern void napi_gro_flush(struct napi_struct *napi, bool flush_old);
|
||||||
extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
|
extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
|
||||||
extern gro_result_t napi_frags_finish(struct napi_struct *napi,
|
extern gro_result_t napi_frags_finish(struct napi_struct *napi,
|
||||||
struct sk_buff *skb,
|
struct sk_buff *skb,
|
||||||
|
|
|
@ -1,78 +1 @@
|
||||||
header-y += ipset/
|
header-y += ipset/
|
||||||
|
|
||||||
header-y += nf_conntrack_common.h
|
|
||||||
header-y += nf_conntrack_ftp.h
|
|
||||||
header-y += nf_conntrack_sctp.h
|
|
||||||
header-y += nf_conntrack_tcp.h
|
|
||||||
header-y += nf_conntrack_tuple_common.h
|
|
||||||
header-y += nf_nat.h
|
|
||||||
header-y += nfnetlink.h
|
|
||||||
header-y += nfnetlink_acct.h
|
|
||||||
header-y += nfnetlink_compat.h
|
|
||||||
header-y += nfnetlink_conntrack.h
|
|
||||||
header-y += nfnetlink_cthelper.h
|
|
||||||
header-y += nfnetlink_cttimeout.h
|
|
||||||
header-y += nfnetlink_log.h
|
|
||||||
header-y += nfnetlink_queue.h
|
|
||||||
header-y += x_tables.h
|
|
||||||
header-y += xt_AUDIT.h
|
|
||||||
header-y += xt_CHECKSUM.h
|
|
||||||
header-y += xt_CLASSIFY.h
|
|
||||||
header-y += xt_CONNMARK.h
|
|
||||||
header-y += xt_CONNSECMARK.h
|
|
||||||
header-y += xt_CT.h
|
|
||||||
header-y += xt_DSCP.h
|
|
||||||
header-y += xt_IDLETIMER.h
|
|
||||||
header-y += xt_LED.h
|
|
||||||
header-y += xt_LOG.h
|
|
||||||
header-y += xt_MARK.h
|
|
||||||
header-y += xt_nfacct.h
|
|
||||||
header-y += xt_NFLOG.h
|
|
||||||
header-y += xt_NFQUEUE.h
|
|
||||||
header-y += xt_RATEEST.h
|
|
||||||
header-y += xt_SECMARK.h
|
|
||||||
header-y += xt_TCPMSS.h
|
|
||||||
header-y += xt_TCPOPTSTRIP.h
|
|
||||||
header-y += xt_TEE.h
|
|
||||||
header-y += xt_TPROXY.h
|
|
||||||
header-y += xt_addrtype.h
|
|
||||||
header-y += xt_cluster.h
|
|
||||||
header-y += xt_comment.h
|
|
||||||
header-y += xt_connbytes.h
|
|
||||||
header-y += xt_connlimit.h
|
|
||||||
header-y += xt_connmark.h
|
|
||||||
header-y += xt_conntrack.h
|
|
||||||
header-y += xt_cpu.h
|
|
||||||
header-y += xt_dccp.h
|
|
||||||
header-y += xt_devgroup.h
|
|
||||||
header-y += xt_dscp.h
|
|
||||||
header-y += xt_ecn.h
|
|
||||||
header-y += xt_esp.h
|
|
||||||
header-y += xt_hashlimit.h
|
|
||||||
header-y += xt_helper.h
|
|
||||||
header-y += xt_iprange.h
|
|
||||||
header-y += xt_ipvs.h
|
|
||||||
header-y += xt_length.h
|
|
||||||
header-y += xt_limit.h
|
|
||||||
header-y += xt_mac.h
|
|
||||||
header-y += xt_mark.h
|
|
||||||
header-y += xt_multiport.h
|
|
||||||
header-y += xt_osf.h
|
|
||||||
header-y += xt_owner.h
|
|
||||||
header-y += xt_physdev.h
|
|
||||||
header-y += xt_pkttype.h
|
|
||||||
header-y += xt_policy.h
|
|
||||||
header-y += xt_quota.h
|
|
||||||
header-y += xt_rateest.h
|
|
||||||
header-y += xt_realm.h
|
|
||||||
header-y += xt_recent.h
|
|
||||||
header-y += xt_set.h
|
|
||||||
header-y += xt_sctp.h
|
|
||||||
header-y += xt_socket.h
|
|
||||||
header-y += xt_state.h
|
|
||||||
header-y += xt_statistic.h
|
|
||||||
header-y += xt_string.h
|
|
||||||
header-y += xt_tcpmss.h
|
|
||||||
header-y += xt_tcpudp.h
|
|
||||||
header-y += xt_time.h
|
|
||||||
header-y += xt_u32.h
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
header-y += ip_set.h
|
|
||||||
header-y += ip_set_bitmap.h
|
|
||||||
header-y += ip_set_hash.h
|
|
||||||
header-y += ip_set_list.h
|
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef _IP_SET_H
|
|
||||||
#define _IP_SET_H
|
|
||||||
|
|
||||||
/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
|
/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
|
||||||
* Patrick Schaaf <bof@bof.de>
|
* Patrick Schaaf <bof@bof.de>
|
||||||
* Martin Josefsson <gandalf@wlug.westbo.se>
|
* Martin Josefsson <gandalf@wlug.westbo.se>
|
||||||
|
@ -10,199 +7,9 @@
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
*/
|
*/
|
||||||
|
#ifndef _IP_SET_H
|
||||||
|
#define _IP_SET_H
|
||||||
|
|
||||||
#include <linux/types.h>
|
|
||||||
|
|
||||||
/* The protocol version */
|
|
||||||
#define IPSET_PROTOCOL 6
|
|
||||||
|
|
||||||
/* The max length of strings including NUL: set and type identifiers */
|
|
||||||
#define IPSET_MAXNAMELEN 32
|
|
||||||
|
|
||||||
/* Message types and commands */
|
|
||||||
enum ipset_cmd {
|
|
||||||
IPSET_CMD_NONE,
|
|
||||||
IPSET_CMD_PROTOCOL, /* 1: Return protocol version */
|
|
||||||
IPSET_CMD_CREATE, /* 2: Create a new (empty) set */
|
|
||||||
IPSET_CMD_DESTROY, /* 3: Destroy a (empty) set */
|
|
||||||
IPSET_CMD_FLUSH, /* 4: Remove all elements from a set */
|
|
||||||
IPSET_CMD_RENAME, /* 5: Rename a set */
|
|
||||||
IPSET_CMD_SWAP, /* 6: Swap two sets */
|
|
||||||
IPSET_CMD_LIST, /* 7: List sets */
|
|
||||||
IPSET_CMD_SAVE, /* 8: Save sets */
|
|
||||||
IPSET_CMD_ADD, /* 9: Add an element to a set */
|
|
||||||
IPSET_CMD_DEL, /* 10: Delete an element from a set */
|
|
||||||
IPSET_CMD_TEST, /* 11: Test an element in a set */
|
|
||||||
IPSET_CMD_HEADER, /* 12: Get set header data only */
|
|
||||||
IPSET_CMD_TYPE, /* 13: Get set type */
|
|
||||||
IPSET_MSG_MAX, /* Netlink message commands */
|
|
||||||
|
|
||||||
/* Commands in userspace: */
|
|
||||||
IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */
|
|
||||||
IPSET_CMD_HELP, /* 15: Get help */
|
|
||||||
IPSET_CMD_VERSION, /* 16: Get program version */
|
|
||||||
IPSET_CMD_QUIT, /* 17: Quit from interactive mode */
|
|
||||||
|
|
||||||
IPSET_CMD_MAX,
|
|
||||||
|
|
||||||
IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Attributes at command level */
|
|
||||||
enum {
|
|
||||||
IPSET_ATTR_UNSPEC,
|
|
||||||
IPSET_ATTR_PROTOCOL, /* 1: Protocol version */
|
|
||||||
IPSET_ATTR_SETNAME, /* 2: Name of the set */
|
|
||||||
IPSET_ATTR_TYPENAME, /* 3: Typename */
|
|
||||||
IPSET_ATTR_SETNAME2 = IPSET_ATTR_TYPENAME, /* Setname at rename/swap */
|
|
||||||
IPSET_ATTR_REVISION, /* 4: Settype revision */
|
|
||||||
IPSET_ATTR_FAMILY, /* 5: Settype family */
|
|
||||||
IPSET_ATTR_FLAGS, /* 6: Flags at command level */
|
|
||||||
IPSET_ATTR_DATA, /* 7: Nested attributes */
|
|
||||||
IPSET_ATTR_ADT, /* 8: Multiple data containers */
|
|
||||||
IPSET_ATTR_LINENO, /* 9: Restore lineno */
|
|
||||||
IPSET_ATTR_PROTOCOL_MIN, /* 10: Minimal supported version number */
|
|
||||||
IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN, /* type rev min */
|
|
||||||
__IPSET_ATTR_CMD_MAX,
|
|
||||||
};
|
|
||||||
#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
|
|
||||||
|
|
||||||
/* CADT specific attributes */
|
|
||||||
enum {
|
|
||||||
IPSET_ATTR_IP = IPSET_ATTR_UNSPEC + 1,
|
|
||||||
IPSET_ATTR_IP_FROM = IPSET_ATTR_IP,
|
|
||||||
IPSET_ATTR_IP_TO, /* 2 */
|
|
||||||
IPSET_ATTR_CIDR, /* 3 */
|
|
||||||
IPSET_ATTR_PORT, /* 4 */
|
|
||||||
IPSET_ATTR_PORT_FROM = IPSET_ATTR_PORT,
|
|
||||||
IPSET_ATTR_PORT_TO, /* 5 */
|
|
||||||
IPSET_ATTR_TIMEOUT, /* 6 */
|
|
||||||
IPSET_ATTR_PROTO, /* 7 */
|
|
||||||
IPSET_ATTR_CADT_FLAGS, /* 8 */
|
|
||||||
IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */
|
|
||||||
/* Reserve empty slots */
|
|
||||||
IPSET_ATTR_CADT_MAX = 16,
|
|
||||||
/* Create-only specific attributes */
|
|
||||||
IPSET_ATTR_GC,
|
|
||||||
IPSET_ATTR_HASHSIZE,
|
|
||||||
IPSET_ATTR_MAXELEM,
|
|
||||||
IPSET_ATTR_NETMASK,
|
|
||||||
IPSET_ATTR_PROBES,
|
|
||||||
IPSET_ATTR_RESIZE,
|
|
||||||
IPSET_ATTR_SIZE,
|
|
||||||
/* Kernel-only */
|
|
||||||
IPSET_ATTR_ELEMENTS,
|
|
||||||
IPSET_ATTR_REFERENCES,
|
|
||||||
IPSET_ATTR_MEMSIZE,
|
|
||||||
|
|
||||||
__IPSET_ATTR_CREATE_MAX,
|
|
||||||
};
|
|
||||||
#define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
|
|
||||||
|
|
||||||
/* ADT specific attributes */
|
|
||||||
enum {
|
|
||||||
IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
|
|
||||||
IPSET_ATTR_NAME,
|
|
||||||
IPSET_ATTR_NAMEREF,
|
|
||||||
IPSET_ATTR_IP2,
|
|
||||||
IPSET_ATTR_CIDR2,
|
|
||||||
IPSET_ATTR_IP2_TO,
|
|
||||||
IPSET_ATTR_IFACE,
|
|
||||||
__IPSET_ATTR_ADT_MAX,
|
|
||||||
};
|
|
||||||
#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
|
|
||||||
|
|
||||||
/* IP specific attributes */
|
|
||||||
enum {
|
|
||||||
IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
|
|
||||||
IPSET_ATTR_IPADDR_IPV6,
|
|
||||||
__IPSET_ATTR_IPADDR_MAX,
|
|
||||||
};
|
|
||||||
#define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
|
|
||||||
|
|
||||||
/* Error codes */
|
|
||||||
enum ipset_errno {
|
|
||||||
IPSET_ERR_PRIVATE = 4096,
|
|
||||||
IPSET_ERR_PROTOCOL,
|
|
||||||
IPSET_ERR_FIND_TYPE,
|
|
||||||
IPSET_ERR_MAX_SETS,
|
|
||||||
IPSET_ERR_BUSY,
|
|
||||||
IPSET_ERR_EXIST_SETNAME2,
|
|
||||||
IPSET_ERR_TYPE_MISMATCH,
|
|
||||||
IPSET_ERR_EXIST,
|
|
||||||
IPSET_ERR_INVALID_CIDR,
|
|
||||||
IPSET_ERR_INVALID_NETMASK,
|
|
||||||
IPSET_ERR_INVALID_FAMILY,
|
|
||||||
IPSET_ERR_TIMEOUT,
|
|
||||||
IPSET_ERR_REFERENCED,
|
|
||||||
IPSET_ERR_IPADDR_IPV4,
|
|
||||||
IPSET_ERR_IPADDR_IPV6,
|
|
||||||
|
|
||||||
/* Type specific error codes */
|
|
||||||
IPSET_ERR_TYPE_SPECIFIC = 4352,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Flags at command level */
|
|
||||||
enum ipset_cmd_flags {
|
|
||||||
IPSET_FLAG_BIT_EXIST = 0,
|
|
||||||
IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
|
|
||||||
IPSET_FLAG_BIT_LIST_SETNAME = 1,
|
|
||||||
IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
|
|
||||||
IPSET_FLAG_BIT_LIST_HEADER = 2,
|
|
||||||
IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
|
|
||||||
IPSET_FLAG_CMD_MAX = 15, /* Lower half */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Flags at CADT attribute level */
|
|
||||||
enum ipset_cadt_flags {
|
|
||||||
IPSET_FLAG_BIT_BEFORE = 0,
|
|
||||||
IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
|
|
||||||
IPSET_FLAG_BIT_PHYSDEV = 1,
|
|
||||||
IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
|
|
||||||
IPSET_FLAG_BIT_NOMATCH = 2,
|
|
||||||
IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
|
|
||||||
IPSET_FLAG_CADT_MAX = 15, /* Upper half */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Commands with settype-specific attributes */
|
|
||||||
enum ipset_adt {
|
|
||||||
IPSET_ADD,
|
|
||||||
IPSET_DEL,
|
|
||||||
IPSET_TEST,
|
|
||||||
IPSET_ADT_MAX,
|
|
||||||
IPSET_CREATE = IPSET_ADT_MAX,
|
|
||||||
IPSET_CADT_MAX,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
|
|
||||||
* and IPSET_INVALID_ID if you want to increase the max number of sets.
|
|
||||||
*/
|
|
||||||
typedef __u16 ip_set_id_t;
|
|
||||||
|
|
||||||
#define IPSET_INVALID_ID 65535
|
|
||||||
|
|
||||||
enum ip_set_dim {
|
|
||||||
IPSET_DIM_ZERO = 0,
|
|
||||||
IPSET_DIM_ONE,
|
|
||||||
IPSET_DIM_TWO,
|
|
||||||
IPSET_DIM_THREE,
|
|
||||||
/* Max dimension in elements.
|
|
||||||
* If changed, new revision of iptables match/target is required.
|
|
||||||
*/
|
|
||||||
IPSET_DIM_MAX = 6,
|
|
||||||
IPSET_BIT_RETURN_NOMATCH = 7,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Option flags for kernel operations */
|
|
||||||
enum ip_set_kopt {
|
|
||||||
IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
|
|
||||||
IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
|
|
||||||
IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
|
|
||||||
IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
|
|
||||||
IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#include <linux/ip.h>
|
#include <linux/ip.h>
|
||||||
#include <linux/ipv6.h>
|
#include <linux/ipv6.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
|
@ -211,6 +18,7 @@ enum ip_set_kopt {
|
||||||
#include <linux/stringify.h>
|
#include <linux/stringify.h>
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include <net/netlink.h>
|
#include <net/netlink.h>
|
||||||
|
#include <uapi/linux/netfilter/ipset/ip_set.h>
|
||||||
|
|
||||||
#define _IP_SET_MODULE_DESC(a, b, c) \
|
#define _IP_SET_MODULE_DESC(a, b, c) \
|
||||||
MODULE_DESCRIPTION(a " type of IP sets, revisions " b "-" c)
|
MODULE_DESCRIPTION(a " type of IP sets, revisions " b "-" c)
|
||||||
|
@ -476,31 +284,4 @@ bitmap_bytes(u32 a, u32 b)
|
||||||
return 4 * ((((b - a + 8) / 8) + 3) / 4);
|
return 4 * ((((b - a + 8) / 8) + 3) / 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
/* Interface to iptables/ip6tables */
|
|
||||||
|
|
||||||
#define SO_IP_SET 83
|
|
||||||
|
|
||||||
union ip_set_name_index {
|
|
||||||
char name[IPSET_MAXNAMELEN];
|
|
||||||
ip_set_id_t index;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define IP_SET_OP_GET_BYNAME 0x00000006 /* Get set index by name */
|
|
||||||
struct ip_set_req_get_set {
|
|
||||||
unsigned int op;
|
|
||||||
unsigned int version;
|
|
||||||
union ip_set_name_index set;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define IP_SET_OP_GET_BYINDEX 0x00000007 /* Get set name by index */
|
|
||||||
/* Uses ip_set_req_get_set */
|
|
||||||
|
|
||||||
#define IP_SET_OP_VERSION 0x00000100 /* Ask kernel version */
|
|
||||||
struct ip_set_req_version {
|
|
||||||
unsigned int op;
|
|
||||||
unsigned int version;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /*_IP_SET_H */
|
#endif /*_IP_SET_H */
|
||||||
|
|
|
@ -1,15 +1,8 @@
|
||||||
#ifndef __IP_SET_BITMAP_H
|
#ifndef __IP_SET_BITMAP_H
|
||||||
#define __IP_SET_BITMAP_H
|
#define __IP_SET_BITMAP_H
|
||||||
|
|
||||||
/* Bitmap type specific error codes */
|
#include <uapi/linux/netfilter/ipset/ip_set_bitmap.h>
|
||||||
enum {
|
|
||||||
/* The element is out of the range of the set */
|
|
||||||
IPSET_ERR_BITMAP_RANGE = IPSET_ERR_TYPE_SPECIFIC,
|
|
||||||
/* The range exceeds the size limit of the set type */
|
|
||||||
IPSET_ERR_BITMAP_RANGE_SIZE,
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#define IPSET_BITMAP_MAX_RANGE 0x0000FFFF
|
#define IPSET_BITMAP_MAX_RANGE 0x0000FFFF
|
||||||
|
|
||||||
/* Common functions */
|
/* Common functions */
|
||||||
|
@ -26,6 +19,4 @@ range_to_mask(u32 from, u32 to, u8 *bits)
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* __IP_SET_BITMAP_H */
|
#endif /* __IP_SET_BITMAP_H */
|
||||||
|
|
|
@ -1,23 +1,8 @@
|
||||||
#ifndef __IP_SET_HASH_H
|
#ifndef __IP_SET_HASH_H
|
||||||
#define __IP_SET_HASH_H
|
#define __IP_SET_HASH_H
|
||||||
|
|
||||||
/* Hash type specific error codes */
|
#include <uapi/linux/netfilter/ipset/ip_set_hash.h>
|
||||||
enum {
|
|
||||||
/* Hash is full */
|
|
||||||
IPSET_ERR_HASH_FULL = IPSET_ERR_TYPE_SPECIFIC,
|
|
||||||
/* Null-valued element */
|
|
||||||
IPSET_ERR_HASH_ELEM,
|
|
||||||
/* Invalid protocol */
|
|
||||||
IPSET_ERR_INVALID_PROTO,
|
|
||||||
/* Protocol missing but must be specified */
|
|
||||||
IPSET_ERR_MISSING_PROTO,
|
|
||||||
/* Range not supported */
|
|
||||||
IPSET_ERR_HASH_RANGE_UNSUPPORTED,
|
|
||||||
/* Invalid range */
|
|
||||||
IPSET_ERR_HASH_RANGE,
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#define IPSET_DEFAULT_HASHSIZE 1024
|
#define IPSET_DEFAULT_HASHSIZE 1024
|
||||||
#define IPSET_MIMINAL_HASHSIZE 64
|
#define IPSET_MIMINAL_HASHSIZE 64
|
||||||
|
@ -25,6 +10,4 @@ enum {
|
||||||
#define IPSET_DEFAULT_PROBES 4
|
#define IPSET_DEFAULT_PROBES 4
|
||||||
#define IPSET_DEFAULT_RESIZE 100
|
#define IPSET_DEFAULT_RESIZE 100
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* __IP_SET_HASH_H */
|
#endif /* __IP_SET_HASH_H */
|
||||||
|
|
|
@ -1,27 +1,10 @@
|
||||||
#ifndef __IP_SET_LIST_H
|
#ifndef __IP_SET_LIST_H
|
||||||
#define __IP_SET_LIST_H
|
#define __IP_SET_LIST_H
|
||||||
|
|
||||||
/* List type specific error codes */
|
#include <uapi/linux/netfilter/ipset/ip_set_list.h>
|
||||||
enum {
|
|
||||||
/* Set name to be added/deleted/tested does not exist. */
|
|
||||||
IPSET_ERR_NAME = IPSET_ERR_TYPE_SPECIFIC,
|
|
||||||
/* list:set type is not permitted to add */
|
|
||||||
IPSET_ERR_LOOP,
|
|
||||||
/* Missing reference set */
|
|
||||||
IPSET_ERR_BEFORE,
|
|
||||||
/* Reference set does not exist */
|
|
||||||
IPSET_ERR_NAMEREF,
|
|
||||||
/* Set is full */
|
|
||||||
IPSET_ERR_LIST_FULL,
|
|
||||||
/* Reference set is not added to the set */
|
|
||||||
IPSET_ERR_REF_EXIST,
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#define IP_SET_LIST_DEFAULT_SIZE 8
|
#define IP_SET_LIST_DEFAULT_SIZE 8
|
||||||
#define IP_SET_LIST_MIN_SIZE 4
|
#define IP_SET_LIST_MIN_SIZE 4
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* __IP_SET_LIST_H */
|
#endif /* __IP_SET_LIST_H */
|
||||||
|
|
|
@ -1,119 +1,8 @@
|
||||||
#ifndef _NF_CONNTRACK_COMMON_H
|
#ifndef _NF_CONNTRACK_COMMON_H
|
||||||
#define _NF_CONNTRACK_COMMON_H
|
#define _NF_CONNTRACK_COMMON_H
|
||||||
/* Connection state tracking for netfilter. This is separated from,
|
|
||||||
but required by, the NAT layer; it can also be used by an iptables
|
|
||||||
extension. */
|
|
||||||
enum ip_conntrack_info {
|
|
||||||
/* Part of an established connection (either direction). */
|
|
||||||
IP_CT_ESTABLISHED,
|
|
||||||
|
|
||||||
/* Like NEW, but related to an existing connection, or ICMP error
|
#include <uapi/linux/netfilter/nf_conntrack_common.h>
|
||||||
(in either direction). */
|
|
||||||
IP_CT_RELATED,
|
|
||||||
|
|
||||||
/* Started a new connection to track (only
|
|
||||||
IP_CT_DIR_ORIGINAL); may be a retransmission. */
|
|
||||||
IP_CT_NEW,
|
|
||||||
|
|
||||||
/* >= this indicates reply direction */
|
|
||||||
IP_CT_IS_REPLY,
|
|
||||||
|
|
||||||
IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY,
|
|
||||||
IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY,
|
|
||||||
IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY,
|
|
||||||
/* Number of distinct IP_CT types (no NEW in reply dirn). */
|
|
||||||
IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Bitset representing status of connection. */
|
|
||||||
enum ip_conntrack_status {
|
|
||||||
/* It's an expected connection: bit 0 set. This bit never changed */
|
|
||||||
IPS_EXPECTED_BIT = 0,
|
|
||||||
IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
|
|
||||||
|
|
||||||
/* We've seen packets both ways: bit 1 set. Can be set, not unset. */
|
|
||||||
IPS_SEEN_REPLY_BIT = 1,
|
|
||||||
IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
|
|
||||||
|
|
||||||
/* Conntrack should never be early-expired. */
|
|
||||||
IPS_ASSURED_BIT = 2,
|
|
||||||
IPS_ASSURED = (1 << IPS_ASSURED_BIT),
|
|
||||||
|
|
||||||
/* Connection is confirmed: originating packet has left box */
|
|
||||||
IPS_CONFIRMED_BIT = 3,
|
|
||||||
IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
|
|
||||||
|
|
||||||
/* Connection needs src nat in orig dir. This bit never changed. */
|
|
||||||
IPS_SRC_NAT_BIT = 4,
|
|
||||||
IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
|
|
||||||
|
|
||||||
/* Connection needs dst nat in orig dir. This bit never changed. */
|
|
||||||
IPS_DST_NAT_BIT = 5,
|
|
||||||
IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
|
|
||||||
|
|
||||||
/* Both together. */
|
|
||||||
IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
|
|
||||||
|
|
||||||
/* Connection needs TCP sequence adjusted. */
|
|
||||||
IPS_SEQ_ADJUST_BIT = 6,
|
|
||||||
IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
|
|
||||||
|
|
||||||
/* NAT initialization bits. */
|
|
||||||
IPS_SRC_NAT_DONE_BIT = 7,
|
|
||||||
IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
|
|
||||||
|
|
||||||
IPS_DST_NAT_DONE_BIT = 8,
|
|
||||||
IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
|
|
||||||
|
|
||||||
/* Both together */
|
|
||||||
IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
|
|
||||||
|
|
||||||
/* Connection is dying (removed from lists), can not be unset. */
|
|
||||||
IPS_DYING_BIT = 9,
|
|
||||||
IPS_DYING = (1 << IPS_DYING_BIT),
|
|
||||||
|
|
||||||
/* Connection has fixed timeout. */
|
|
||||||
IPS_FIXED_TIMEOUT_BIT = 10,
|
|
||||||
IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
|
|
||||||
|
|
||||||
/* Conntrack is a template */
|
|
||||||
IPS_TEMPLATE_BIT = 11,
|
|
||||||
IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT),
|
|
||||||
|
|
||||||
/* Conntrack is a fake untracked entry */
|
|
||||||
IPS_UNTRACKED_BIT = 12,
|
|
||||||
IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
|
|
||||||
|
|
||||||
/* Conntrack got a helper explicitly attached via CT target. */
|
|
||||||
IPS_HELPER_BIT = 13,
|
|
||||||
IPS_HELPER = (1 << IPS_HELPER_BIT),
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Connection tracking event types */
|
|
||||||
enum ip_conntrack_events {
|
|
||||||
IPCT_NEW, /* new conntrack */
|
|
||||||
IPCT_RELATED, /* related conntrack */
|
|
||||||
IPCT_DESTROY, /* destroyed conntrack */
|
|
||||||
IPCT_REPLY, /* connection has seen two-way traffic */
|
|
||||||
IPCT_ASSURED, /* connection status has changed to assured */
|
|
||||||
IPCT_PROTOINFO, /* protocol information has changed */
|
|
||||||
IPCT_HELPER, /* new helper has been set */
|
|
||||||
IPCT_MARK, /* new mark has been set */
|
|
||||||
IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
|
|
||||||
IPCT_SECMARK, /* new security mark has been set */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ip_conntrack_expect_events {
|
|
||||||
IPEXP_NEW, /* new expectation */
|
|
||||||
IPEXP_DESTROY, /* destroyed expectation */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* expectation flags */
|
|
||||||
#define NF_CT_EXPECT_PERMANENT 0x1
|
|
||||||
#define NF_CT_EXPECT_INACTIVE 0x2
|
|
||||||
#define NF_CT_EXPECT_USERSPACE 0x4
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
struct ip_conntrack_stat {
|
struct ip_conntrack_stat {
|
||||||
unsigned int searched;
|
unsigned int searched;
|
||||||
unsigned int found;
|
unsigned int found;
|
||||||
|
@ -136,6 +25,4 @@ struct ip_conntrack_stat {
|
||||||
/* call to create an explicit dependency on nf_conntrack. */
|
/* call to create an explicit dependency on nf_conntrack. */
|
||||||
extern void need_conntrack(void);
|
extern void need_conntrack(void);
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* _NF_CONNTRACK_COMMON_H */
|
#endif /* _NF_CONNTRACK_COMMON_H */
|
||||||
|
|
|
@ -1,20 +1,8 @@
|
||||||
#ifndef _NF_CONNTRACK_FTP_H
|
#ifndef _NF_CONNTRACK_FTP_H
|
||||||
#define _NF_CONNTRACK_FTP_H
|
#define _NF_CONNTRACK_FTP_H
|
||||||
/* FTP tracking. */
|
|
||||||
|
|
||||||
/* This enum is exposed to userspace */
|
#include <uapi/linux/netfilter/nf_conntrack_ftp.h>
|
||||||
enum nf_ct_ftp_type {
|
|
||||||
/* PORT command from client */
|
|
||||||
NF_CT_FTP_PORT,
|
|
||||||
/* PASV response from server */
|
|
||||||
NF_CT_FTP_PASV,
|
|
||||||
/* EPRT command from client */
|
|
||||||
NF_CT_FTP_EPRT,
|
|
||||||
/* EPSV response from server */
|
|
||||||
NF_CT_FTP_EPSV,
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#define FTP_PORT 21
|
#define FTP_PORT 21
|
||||||
|
|
||||||
|
@ -42,6 +30,4 @@ extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
|
||||||
unsigned int matchoff,
|
unsigned int matchoff,
|
||||||
unsigned int matchlen,
|
unsigned int matchlen,
|
||||||
struct nf_conntrack_expect *exp);
|
struct nf_conntrack_expect *exp);
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* _NF_CONNTRACK_FTP_H */
|
#endif /* _NF_CONNTRACK_FTP_H */
|
||||||
|
|
|
@ -1,53 +1,8 @@
|
||||||
#ifndef _NF_CONNTRACK_TCP_H
|
#ifndef _NF_CONNTRACK_TCP_H
|
||||||
#define _NF_CONNTRACK_TCP_H
|
#define _NF_CONNTRACK_TCP_H
|
||||||
/* TCP tracking. */
|
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <uapi/linux/netfilter/nf_conntrack_tcp.h>
|
||||||
|
|
||||||
/* This is exposed to userspace (ctnetlink) */
|
|
||||||
enum tcp_conntrack {
|
|
||||||
TCP_CONNTRACK_NONE,
|
|
||||||
TCP_CONNTRACK_SYN_SENT,
|
|
||||||
TCP_CONNTRACK_SYN_RECV,
|
|
||||||
TCP_CONNTRACK_ESTABLISHED,
|
|
||||||
TCP_CONNTRACK_FIN_WAIT,
|
|
||||||
TCP_CONNTRACK_CLOSE_WAIT,
|
|
||||||
TCP_CONNTRACK_LAST_ACK,
|
|
||||||
TCP_CONNTRACK_TIME_WAIT,
|
|
||||||
TCP_CONNTRACK_CLOSE,
|
|
||||||
TCP_CONNTRACK_LISTEN, /* obsolete */
|
|
||||||
#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN
|
|
||||||
TCP_CONNTRACK_MAX,
|
|
||||||
TCP_CONNTRACK_IGNORE,
|
|
||||||
TCP_CONNTRACK_RETRANS,
|
|
||||||
TCP_CONNTRACK_UNACK,
|
|
||||||
TCP_CONNTRACK_TIMEOUT_MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Window scaling is advertised by the sender */
|
|
||||||
#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
|
|
||||||
|
|
||||||
/* SACK is permitted by the sender */
|
|
||||||
#define IP_CT_TCP_FLAG_SACK_PERM 0x02
|
|
||||||
|
|
||||||
/* This sender sent FIN first */
|
|
||||||
#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
|
|
||||||
|
|
||||||
/* Be liberal in window checking */
|
|
||||||
#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
|
|
||||||
|
|
||||||
/* Has unacknowledged data */
|
|
||||||
#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10
|
|
||||||
|
|
||||||
/* The field td_maxack has been set */
|
|
||||||
#define IP_CT_TCP_FLAG_MAXACK_SET 0x20
|
|
||||||
|
|
||||||
struct nf_ct_tcp_flags {
|
|
||||||
__u8 flags;
|
|
||||||
__u8 mask;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
struct ip_ct_tcp_state {
|
struct ip_ct_tcp_state {
|
||||||
u_int32_t td_end; /* max of seq + len */
|
u_int32_t td_end; /* max of seq + len */
|
||||||
|
@ -74,6 +29,4 @@ struct ip_ct_tcp {
|
||||||
u_int8_t last_flags; /* Last flags set */
|
u_int8_t last_flags; /* Last flags set */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* _NF_CONNTRACK_TCP_H */
|
#endif /* _NF_CONNTRACK_TCP_H */
|
||||||
|
|
|
@ -1,63 +1,11 @@
|
||||||
#ifndef _NFNETLINK_H
|
#ifndef _NFNETLINK_H
|
||||||
#define _NFNETLINK_H
|
#define _NFNETLINK_H
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/netfilter/nfnetlink_compat.h>
|
|
||||||
|
|
||||||
enum nfnetlink_groups {
|
|
||||||
NFNLGRP_NONE,
|
|
||||||
#define NFNLGRP_NONE NFNLGRP_NONE
|
|
||||||
NFNLGRP_CONNTRACK_NEW,
|
|
||||||
#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
|
|
||||||
NFNLGRP_CONNTRACK_UPDATE,
|
|
||||||
#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
|
|
||||||
NFNLGRP_CONNTRACK_DESTROY,
|
|
||||||
#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
|
|
||||||
NFNLGRP_CONNTRACK_EXP_NEW,
|
|
||||||
#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
|
|
||||||
NFNLGRP_CONNTRACK_EXP_UPDATE,
|
|
||||||
#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
|
|
||||||
NFNLGRP_CONNTRACK_EXP_DESTROY,
|
|
||||||
#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
|
|
||||||
__NFNLGRP_MAX,
|
|
||||||
};
|
|
||||||
#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
|
|
||||||
|
|
||||||
/* General form of address family dependent message.
|
|
||||||
*/
|
|
||||||
struct nfgenmsg {
|
|
||||||
__u8 nfgen_family; /* AF_xxx */
|
|
||||||
__u8 version; /* nfnetlink version */
|
|
||||||
__be16 res_id; /* resource id */
|
|
||||||
};
|
|
||||||
|
|
||||||
#define NFNETLINK_V0 0
|
|
||||||
|
|
||||||
/* netfilter netlink message types are split in two pieces:
|
|
||||||
* 8 bit subsystem, 8bit operation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
|
|
||||||
#define NFNL_MSG_TYPE(x) (x & 0x00ff)
|
|
||||||
|
|
||||||
/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
|
|
||||||
* won't work anymore */
|
|
||||||
#define NFNL_SUBSYS_NONE 0
|
|
||||||
#define NFNL_SUBSYS_CTNETLINK 1
|
|
||||||
#define NFNL_SUBSYS_CTNETLINK_EXP 2
|
|
||||||
#define NFNL_SUBSYS_QUEUE 3
|
|
||||||
#define NFNL_SUBSYS_ULOG 4
|
|
||||||
#define NFNL_SUBSYS_OSF 5
|
|
||||||
#define NFNL_SUBSYS_IPSET 6
|
|
||||||
#define NFNL_SUBSYS_ACCT 7
|
|
||||||
#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
|
|
||||||
#define NFNL_SUBSYS_CTHELPER 9
|
|
||||||
#define NFNL_SUBSYS_COUNT 10
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/capability.h>
|
#include <linux/capability.h>
|
||||||
#include <net/netlink.h>
|
#include <net/netlink.h>
|
||||||
|
#include <uapi/linux/netfilter/nfnetlink.h>
|
||||||
|
|
||||||
struct nfnl_callback {
|
struct nfnl_callback {
|
||||||
int (*call)(struct sock *nl, struct sk_buff *skb,
|
int (*call)(struct sock *nl, struct sk_buff *skb,
|
||||||
|
@ -92,5 +40,4 @@ extern void nfnl_unlock(void);
|
||||||
#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
|
#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
|
||||||
MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
|
MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
#endif /* _NFNETLINK_H */
|
#endif /* _NFNETLINK_H */
|
||||||
|
|
|
@ -1,29 +1,8 @@
|
||||||
#ifndef _NFNL_ACCT_H_
|
#ifndef _NFNL_ACCT_H_
|
||||||
#define _NFNL_ACCT_H_
|
#define _NFNL_ACCT_H_
|
||||||
|
|
||||||
#ifndef NFACCT_NAME_MAX
|
#include <uapi/linux/netfilter/nfnetlink_acct.h>
|
||||||
#define NFACCT_NAME_MAX 32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum nfnl_acct_msg_types {
|
|
||||||
NFNL_MSG_ACCT_NEW,
|
|
||||||
NFNL_MSG_ACCT_GET,
|
|
||||||
NFNL_MSG_ACCT_GET_CTRZERO,
|
|
||||||
NFNL_MSG_ACCT_DEL,
|
|
||||||
NFNL_MSG_ACCT_MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
enum nfnl_acct_type {
|
|
||||||
NFACCT_UNSPEC,
|
|
||||||
NFACCT_NAME,
|
|
||||||
NFACCT_PKTS,
|
|
||||||
NFACCT_BYTES,
|
|
||||||
NFACCT_USE,
|
|
||||||
__NFACCT_MAX
|
|
||||||
};
|
|
||||||
#define NFACCT_MAX (__NFACCT_MAX - 1)
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
struct nf_acct;
|
struct nf_acct;
|
||||||
|
|
||||||
|
@ -31,6 +10,4 @@ extern struct nf_acct *nfnl_acct_find_get(const char *filter_name);
|
||||||
extern void nfnl_acct_put(struct nf_acct *acct);
|
extern void nfnl_acct_put(struct nf_acct *acct);
|
||||||
extern void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct);
|
extern void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct);
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* _NFNL_ACCT_H */
|
#endif /* _NFNL_ACCT_H */
|
||||||
|
|
|
@ -1,191 +1,9 @@
|
||||||
#ifndef _X_TABLES_H
|
#ifndef _X_TABLES_H
|
||||||
#define _X_TABLES_H
|
#define _X_TABLES_H
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/types.h>
|
|
||||||
|
|
||||||
#define XT_FUNCTION_MAXNAMELEN 30
|
|
||||||
#define XT_EXTENSION_MAXNAMELEN 29
|
|
||||||
#define XT_TABLE_MAXNAMELEN 32
|
|
||||||
|
|
||||||
struct xt_entry_match {
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
__u16 match_size;
|
|
||||||
|
|
||||||
/* Used by userspace */
|
|
||||||
char name[XT_EXTENSION_MAXNAMELEN];
|
|
||||||
__u8 revision;
|
|
||||||
} user;
|
|
||||||
struct {
|
|
||||||
__u16 match_size;
|
|
||||||
|
|
||||||
/* Used inside the kernel */
|
|
||||||
struct xt_match *match;
|
|
||||||
} kernel;
|
|
||||||
|
|
||||||
/* Total length */
|
|
||||||
__u16 match_size;
|
|
||||||
} u;
|
|
||||||
|
|
||||||
unsigned char data[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_entry_target {
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
__u16 target_size;
|
|
||||||
|
|
||||||
/* Used by userspace */
|
|
||||||
char name[XT_EXTENSION_MAXNAMELEN];
|
|
||||||
__u8 revision;
|
|
||||||
} user;
|
|
||||||
struct {
|
|
||||||
__u16 target_size;
|
|
||||||
|
|
||||||
/* Used inside the kernel */
|
|
||||||
struct xt_target *target;
|
|
||||||
} kernel;
|
|
||||||
|
|
||||||
/* Total length */
|
|
||||||
__u16 target_size;
|
|
||||||
} u;
|
|
||||||
|
|
||||||
unsigned char data[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
#define XT_TARGET_INIT(__name, __size) \
|
|
||||||
{ \
|
|
||||||
.target.u.user = { \
|
|
||||||
.target_size = XT_ALIGN(__size), \
|
|
||||||
.name = __name, \
|
|
||||||
}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
struct xt_standard_target {
|
|
||||||
struct xt_entry_target target;
|
|
||||||
int verdict;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_error_target {
|
|
||||||
struct xt_entry_target target;
|
|
||||||
char errorname[XT_FUNCTION_MAXNAMELEN];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
|
|
||||||
* kernel supports, if >= revision. */
|
|
||||||
struct xt_get_revision {
|
|
||||||
char name[XT_EXTENSION_MAXNAMELEN];
|
|
||||||
__u8 revision;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* CONTINUE verdict for targets */
|
|
||||||
#define XT_CONTINUE 0xFFFFFFFF
|
|
||||||
|
|
||||||
/* For standard target */
|
|
||||||
#define XT_RETURN (-NF_REPEAT - 1)
|
|
||||||
|
|
||||||
/* this is a dummy structure to find out the alignment requirement for a struct
|
|
||||||
* containing all the fundamental data types that are used in ipt_entry,
|
|
||||||
* ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
|
|
||||||
* personal pleasure to remove it -HW
|
|
||||||
*/
|
|
||||||
struct _xt_align {
|
|
||||||
__u8 u8;
|
|
||||||
__u16 u16;
|
|
||||||
__u32 u32;
|
|
||||||
__u64 u64;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
|
|
||||||
|
|
||||||
/* Standard return verdict, or do jump. */
|
|
||||||
#define XT_STANDARD_TARGET ""
|
|
||||||
/* Error verdict. */
|
|
||||||
#define XT_ERROR_TARGET "ERROR"
|
|
||||||
|
|
||||||
#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
|
|
||||||
#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
|
|
||||||
|
|
||||||
struct xt_counters {
|
|
||||||
__u64 pcnt, bcnt; /* Packet and byte counters */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to IPT_SO_ADD_COUNTERS. */
|
|
||||||
struct xt_counters_info {
|
|
||||||
/* Which table. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
unsigned int num_counters;
|
|
||||||
|
|
||||||
/* The counters (actually `number' of these). */
|
|
||||||
struct xt_counters counters[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
|
|
||||||
|
|
||||||
#ifndef __KERNEL__
|
|
||||||
/* fn returns 0 to continue iteration */
|
|
||||||
#define XT_MATCH_ITERATE(type, e, fn, args...) \
|
|
||||||
({ \
|
|
||||||
unsigned int __i; \
|
|
||||||
int __ret = 0; \
|
|
||||||
struct xt_entry_match *__m; \
|
|
||||||
\
|
|
||||||
for (__i = sizeof(type); \
|
|
||||||
__i < (e)->target_offset; \
|
|
||||||
__i += __m->u.match_size) { \
|
|
||||||
__m = (void *)e + __i; \
|
|
||||||
\
|
|
||||||
__ret = fn(__m , ## args); \
|
|
||||||
if (__ret != 0) \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
__ret; \
|
|
||||||
})
|
|
||||||
|
|
||||||
/* fn returns 0 to continue iteration */
|
|
||||||
#define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \
|
|
||||||
({ \
|
|
||||||
unsigned int __i, __n; \
|
|
||||||
int __ret = 0; \
|
|
||||||
type *__entry; \
|
|
||||||
\
|
|
||||||
for (__i = 0, __n = 0; __i < (size); \
|
|
||||||
__i += __entry->next_offset, __n++) { \
|
|
||||||
__entry = (void *)(entries) + __i; \
|
|
||||||
if (__n < n) \
|
|
||||||
continue; \
|
|
||||||
\
|
|
||||||
__ret = fn(__entry , ## args); \
|
|
||||||
if (__ret != 0) \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
__ret; \
|
|
||||||
})
|
|
||||||
|
|
||||||
/* fn returns 0 to continue iteration */
|
|
||||||
#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \
|
|
||||||
XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
|
|
||||||
|
|
||||||
#endif /* !__KERNEL__ */
|
|
||||||
|
|
||||||
/* pos is normally a struct ipt_entry/ip6t_entry/etc. */
|
|
||||||
#define xt_entry_foreach(pos, ehead, esize) \
|
|
||||||
for ((pos) = (typeof(pos))(ehead); \
|
|
||||||
(pos) < (typeof(pos))((char *)(ehead) + (esize)); \
|
|
||||||
(pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
|
|
||||||
|
|
||||||
/* can only be xt_entry_match, so no use of typeof here */
|
|
||||||
#define xt_ematch_foreach(pos, entry) \
|
|
||||||
for ((pos) = (struct xt_entry_match *)entry->elems; \
|
|
||||||
(pos) < (struct xt_entry_match *)((char *)(entry) + \
|
|
||||||
(entry)->target_offset); \
|
|
||||||
(pos) = (struct xt_entry_match *)((char *)(pos) + \
|
|
||||||
(pos)->u.match_size))
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#include <linux/netdevice.h>
|
#include <linux/netdevice.h>
|
||||||
|
#include <uapi/linux/netfilter/x_tables.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct xt_action_param - parameters for matches/targets
|
* struct xt_action_param - parameters for matches/targets
|
||||||
|
@ -617,6 +435,4 @@ extern int xt_compat_target_to_user(const struct xt_entry_target *t,
|
||||||
void __user **dstptr, unsigned int *size);
|
void __user **dstptr, unsigned int *size);
|
||||||
|
|
||||||
#endif /* CONFIG_COMPAT */
|
#endif /* CONFIG_COMPAT */
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* _X_TABLES_H */
|
#endif /* _X_TABLES_H */
|
||||||
|
|
|
@ -1,78 +1,9 @@
|
||||||
#ifndef _XT_HASHLIMIT_H
|
#ifndef _XT_HASHLIMIT_H
|
||||||
#define _XT_HASHLIMIT_H
|
#define _XT_HASHLIMIT_H
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <uapi/linux/netfilter/xt_hashlimit.h>
|
||||||
|
|
||||||
/* timings are in milliseconds. */
|
|
||||||
#define XT_HASHLIMIT_SCALE 10000
|
|
||||||
/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
|
|
||||||
* seconds, or one packet every 59 hours.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* packet length accounting is done in 16-byte steps */
|
|
||||||
#define XT_HASHLIMIT_BYTE_SHIFT 4
|
|
||||||
|
|
||||||
/* details of this structure hidden by the implementation */
|
|
||||||
struct xt_hashlimit_htable;
|
|
||||||
|
|
||||||
enum {
|
|
||||||
XT_HASHLIMIT_HASH_DIP = 1 << 0,
|
|
||||||
XT_HASHLIMIT_HASH_DPT = 1 << 1,
|
|
||||||
XT_HASHLIMIT_HASH_SIP = 1 << 2,
|
|
||||||
XT_HASHLIMIT_HASH_SPT = 1 << 3,
|
|
||||||
XT_HASHLIMIT_INVERT = 1 << 4,
|
|
||||||
XT_HASHLIMIT_BYTES = 1 << 5,
|
|
||||||
};
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \
|
#define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \
|
||||||
XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \
|
XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \
|
||||||
XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES)
|
XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES)
|
||||||
#endif
|
|
||||||
|
|
||||||
struct hashlimit_cfg {
|
|
||||||
__u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
|
|
||||||
__u32 avg; /* Average secs between packets * scale */
|
|
||||||
__u32 burst; /* Period multiplier for upper limit. */
|
|
||||||
|
|
||||||
/* user specified */
|
|
||||||
__u32 size; /* how many buckets */
|
|
||||||
__u32 max; /* max number of entries */
|
|
||||||
__u32 gc_interval; /* gc interval */
|
|
||||||
__u32 expire; /* when do entries expire? */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_hashlimit_info {
|
|
||||||
char name [IFNAMSIZ]; /* name */
|
|
||||||
struct hashlimit_cfg cfg;
|
|
||||||
|
|
||||||
/* Used internally by the kernel */
|
|
||||||
struct xt_hashlimit_htable *hinfo;
|
|
||||||
union {
|
|
||||||
void *ptr;
|
|
||||||
struct xt_hashlimit_info *master;
|
|
||||||
} u;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct hashlimit_cfg1 {
|
|
||||||
__u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
|
|
||||||
__u32 avg; /* Average secs between packets * scale */
|
|
||||||
__u32 burst; /* Period multiplier for upper limit. */
|
|
||||||
|
|
||||||
/* user specified */
|
|
||||||
__u32 size; /* how many buckets */
|
|
||||||
__u32 max; /* max number of entries */
|
|
||||||
__u32 gc_interval; /* gc interval */
|
|
||||||
__u32 expire; /* when do entries expire? */
|
|
||||||
|
|
||||||
__u8 srcmask, dstmask;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_hashlimit_mtinfo1 {
|
|
||||||
char name[IFNAMSIZ];
|
|
||||||
struct hashlimit_cfg1 cfg;
|
|
||||||
|
|
||||||
/* Used internally by the kernel */
|
|
||||||
struct xt_hashlimit_htable *hinfo __attribute__((aligned(8)));
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /*_XT_HASHLIMIT_H*/
|
#endif /*_XT_HASHLIMIT_H*/
|
||||||
|
|
|
@ -1,26 +1,7 @@
|
||||||
#ifndef _XT_PHYSDEV_H
|
#ifndef _XT_PHYSDEV_H
|
||||||
#define _XT_PHYSDEV_H
|
#define _XT_PHYSDEV_H
|
||||||
|
|
||||||
#include <linux/types.h>
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
#endif
|
#include <uapi/linux/netfilter/xt_physdev.h>
|
||||||
|
|
||||||
#define XT_PHYSDEV_OP_IN 0x01
|
|
||||||
#define XT_PHYSDEV_OP_OUT 0x02
|
|
||||||
#define XT_PHYSDEV_OP_BRIDGED 0x04
|
|
||||||
#define XT_PHYSDEV_OP_ISIN 0x08
|
|
||||||
#define XT_PHYSDEV_OP_ISOUT 0x10
|
|
||||||
#define XT_PHYSDEV_OP_MASK (0x20 - 1)
|
|
||||||
|
|
||||||
struct xt_physdev_info {
|
|
||||||
char physindev[IFNAMSIZ];
|
|
||||||
char in_mask[IFNAMSIZ];
|
|
||||||
char physoutdev[IFNAMSIZ];
|
|
||||||
char out_mask[IFNAMSIZ];
|
|
||||||
__u8 invert;
|
|
||||||
__u8 bitmask;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /*_XT_PHYSDEV_H*/
|
#endif /*_XT_PHYSDEV_H*/
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
header-y += arp_tables.h
|
|
||||||
header-y += arpt_mangle.h
|
|
|
@ -5,211 +5,14 @@
|
||||||
* network byte order.
|
* network byte order.
|
||||||
* flags are stored in host byte order (of course).
|
* flags are stored in host byte order (of course).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _ARPTABLES_H
|
#ifndef _ARPTABLES_H
|
||||||
#define _ARPTABLES_H
|
#define _ARPTABLES_H
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
#include <linux/in.h>
|
#include <linux/in.h>
|
||||||
#include <linux/if_arp.h>
|
#include <linux/if_arp.h>
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
#endif
|
#include <uapi/linux/netfilter_arp/arp_tables.h>
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/compiler.h>
|
|
||||||
#include <linux/netfilter_arp.h>
|
|
||||||
|
|
||||||
#include <linux/netfilter/x_tables.h>
|
|
||||||
|
|
||||||
#ifndef __KERNEL__
|
|
||||||
#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
|
|
||||||
#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
|
|
||||||
#define arpt_entry_target xt_entry_target
|
|
||||||
#define arpt_standard_target xt_standard_target
|
|
||||||
#define arpt_error_target xt_error_target
|
|
||||||
#define ARPT_CONTINUE XT_CONTINUE
|
|
||||||
#define ARPT_RETURN XT_RETURN
|
|
||||||
#define arpt_counters_info xt_counters_info
|
|
||||||
#define arpt_counters xt_counters
|
|
||||||
#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
|
|
||||||
#define ARPT_ERROR_TARGET XT_ERROR_TARGET
|
|
||||||
#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
|
|
||||||
XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ARPT_DEV_ADDR_LEN_MAX 16
|
|
||||||
|
|
||||||
struct arpt_devaddr_info {
|
|
||||||
char addr[ARPT_DEV_ADDR_LEN_MAX];
|
|
||||||
char mask[ARPT_DEV_ADDR_LEN_MAX];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Yes, Virginia, you have to zero the padding. */
|
|
||||||
struct arpt_arp {
|
|
||||||
/* Source and target IP addr */
|
|
||||||
struct in_addr src, tgt;
|
|
||||||
/* Mask for src and target IP addr */
|
|
||||||
struct in_addr smsk, tmsk;
|
|
||||||
|
|
||||||
/* Device hw address length, src+target device addresses */
|
|
||||||
__u8 arhln, arhln_mask;
|
|
||||||
struct arpt_devaddr_info src_devaddr;
|
|
||||||
struct arpt_devaddr_info tgt_devaddr;
|
|
||||||
|
|
||||||
/* ARP operation code. */
|
|
||||||
__be16 arpop, arpop_mask;
|
|
||||||
|
|
||||||
/* ARP hardware address and protocol address format. */
|
|
||||||
__be16 arhrd, arhrd_mask;
|
|
||||||
__be16 arpro, arpro_mask;
|
|
||||||
|
|
||||||
/* The protocol address length is only accepted if it is 4
|
|
||||||
* so there is no use in offering a way to do filtering on it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
|
|
||||||
unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
|
|
||||||
|
|
||||||
/* Flags word */
|
|
||||||
__u8 flags;
|
|
||||||
/* Inverse flags */
|
|
||||||
__u16 invflags;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Values for "flag" field in struct arpt_ip (general arp structure).
|
|
||||||
* No flags defined yet.
|
|
||||||
*/
|
|
||||||
#define ARPT_F_MASK 0x00 /* All possible flag bits mask. */
|
|
||||||
|
|
||||||
/* Values for "inv" field in struct arpt_arp. */
|
|
||||||
#define ARPT_INV_VIA_IN 0x0001 /* Invert the sense of IN IFACE. */
|
|
||||||
#define ARPT_INV_VIA_OUT 0x0002 /* Invert the sense of OUT IFACE */
|
|
||||||
#define ARPT_INV_SRCIP 0x0004 /* Invert the sense of SRC IP. */
|
|
||||||
#define ARPT_INV_TGTIP 0x0008 /* Invert the sense of TGT IP. */
|
|
||||||
#define ARPT_INV_SRCDEVADDR 0x0010 /* Invert the sense of SRC DEV ADDR. */
|
|
||||||
#define ARPT_INV_TGTDEVADDR 0x0020 /* Invert the sense of TGT DEV ADDR. */
|
|
||||||
#define ARPT_INV_ARPOP 0x0040 /* Invert the sense of ARP OP. */
|
|
||||||
#define ARPT_INV_ARPHRD 0x0080 /* Invert the sense of ARP HRD. */
|
|
||||||
#define ARPT_INV_ARPPRO 0x0100 /* Invert the sense of ARP PRO. */
|
|
||||||
#define ARPT_INV_ARPHLN 0x0200 /* Invert the sense of ARP HLN. */
|
|
||||||
#define ARPT_INV_MASK 0x03FF /* All possible flag bits mask. */
|
|
||||||
|
|
||||||
/* This structure defines each of the firewall rules. Consists of 3
|
|
||||||
parts which are 1) general ARP header stuff 2) match specific
|
|
||||||
stuff 3) the target to perform if the rule matches */
|
|
||||||
struct arpt_entry
|
|
||||||
{
|
|
||||||
struct arpt_arp arp;
|
|
||||||
|
|
||||||
/* Size of arpt_entry + matches */
|
|
||||||
__u16 target_offset;
|
|
||||||
/* Size of arpt_entry + matches + target */
|
|
||||||
__u16 next_offset;
|
|
||||||
|
|
||||||
/* Back pointer */
|
|
||||||
unsigned int comefrom;
|
|
||||||
|
|
||||||
/* Packet and byte counters. */
|
|
||||||
struct xt_counters counters;
|
|
||||||
|
|
||||||
/* The matches (if any), then the target. */
|
|
||||||
unsigned char elems[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* New IP firewall options for [gs]etsockopt at the RAW IP level.
|
|
||||||
* Unlike BSD Linux inherits IP options so you don't have to use a raw
|
|
||||||
* socket for this. Instead we check rights in the calls.
|
|
||||||
*
|
|
||||||
* ATTENTION: check linux/in.h before adding new number here.
|
|
||||||
*/
|
|
||||||
#define ARPT_BASE_CTL 96
|
|
||||||
|
|
||||||
#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
|
|
||||||
#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
|
|
||||||
#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
|
|
||||||
|
|
||||||
#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
|
|
||||||
#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
|
|
||||||
/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
|
|
||||||
#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
|
|
||||||
#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
|
|
||||||
|
|
||||||
/* The argument to ARPT_SO_GET_INFO */
|
|
||||||
struct arpt_getinfo {
|
|
||||||
/* Which table: caller fills this in. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* Kernel fills these in. */
|
|
||||||
/* Which hook entry points are valid: bitmask */
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
|
|
||||||
/* Hook entry points: one per netfilter hook. */
|
|
||||||
unsigned int hook_entry[NF_ARP_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Underflow points. */
|
|
||||||
unsigned int underflow[NF_ARP_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Number of entries */
|
|
||||||
unsigned int num_entries;
|
|
||||||
|
|
||||||
/* Size of entries. */
|
|
||||||
unsigned int size;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to ARPT_SO_SET_REPLACE. */
|
|
||||||
struct arpt_replace {
|
|
||||||
/* Which table. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* Which hook entry points are valid: bitmask. You can't
|
|
||||||
change this. */
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
|
|
||||||
/* Number of entries */
|
|
||||||
unsigned int num_entries;
|
|
||||||
|
|
||||||
/* Total size of new entries */
|
|
||||||
unsigned int size;
|
|
||||||
|
|
||||||
/* Hook entry points. */
|
|
||||||
unsigned int hook_entry[NF_ARP_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Underflow points. */
|
|
||||||
unsigned int underflow[NF_ARP_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Information about old entries: */
|
|
||||||
/* Number of counters (must be equal to current number of entries). */
|
|
||||||
unsigned int num_counters;
|
|
||||||
/* The old entries' counters. */
|
|
||||||
struct xt_counters __user *counters;
|
|
||||||
|
|
||||||
/* The entries (hang off end: not really an array). */
|
|
||||||
struct arpt_entry entries[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to ARPT_SO_GET_ENTRIES. */
|
|
||||||
struct arpt_get_entries {
|
|
||||||
/* Which table: user fills this in. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* User fills this in: total entry size. */
|
|
||||||
unsigned int size;
|
|
||||||
|
|
||||||
/* The entries. */
|
|
||||||
struct arpt_entry entrytable[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Helper functions */
|
|
||||||
static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
|
|
||||||
{
|
|
||||||
return (void *)e + e->target_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main firewall chains definitions and global var's definitions.
|
|
||||||
*/
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
/* Standard entry. */
|
/* Standard entry. */
|
||||||
struct arpt_standard {
|
struct arpt_standard {
|
||||||
|
@ -274,5 +77,4 @@ compat_arpt_get_target(struct compat_arpt_entry *e)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_COMPAT */
|
#endif /* CONFIG_COMPAT */
|
||||||
#endif /*__KERNEL__*/
|
|
||||||
#endif /* _ARPTABLES_H */
|
#endif /* _ARPTABLES_H */
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
header-y += ebt_802_3.h
|
|
||||||
header-y += ebt_among.h
|
|
||||||
header-y += ebt_arp.h
|
|
||||||
header-y += ebt_arpreply.h
|
|
||||||
header-y += ebt_ip.h
|
|
||||||
header-y += ebt_ip6.h
|
|
||||||
header-y += ebt_limit.h
|
|
||||||
header-y += ebt_log.h
|
|
||||||
header-y += ebt_mark_m.h
|
|
||||||
header-y += ebt_mark_t.h
|
|
||||||
header-y += ebt_nat.h
|
|
||||||
header-y += ebt_nflog.h
|
|
||||||
header-y += ebt_pkttype.h
|
|
||||||
header-y += ebt_redirect.h
|
|
||||||
header-y += ebt_stp.h
|
|
||||||
header-y += ebt_ulog.h
|
|
||||||
header-y += ebt_vlan.h
|
|
||||||
header-y += ebtables.h
|
|
|
@ -1,70 +1,11 @@
|
||||||
#ifndef __LINUX_BRIDGE_EBT_802_3_H
|
#ifndef __LINUX_BRIDGE_EBT_802_3_H
|
||||||
#define __LINUX_BRIDGE_EBT_802_3_H
|
#define __LINUX_BRIDGE_EBT_802_3_H
|
||||||
|
|
||||||
#include <linux/types.h>
|
|
||||||
|
|
||||||
#define EBT_802_3_SAP 0x01
|
|
||||||
#define EBT_802_3_TYPE 0x02
|
|
||||||
|
|
||||||
#define EBT_802_3_MATCH "802_3"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If frame has DSAP/SSAP value 0xaa you must check the SNAP type
|
|
||||||
* to discover what kind of packet we're carrying.
|
|
||||||
*/
|
|
||||||
#define CHECK_TYPE 0xaa
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Control field may be one or two bytes. If the first byte has
|
|
||||||
* the value 0x03 then the entire length is one byte, otherwise it is two.
|
|
||||||
* One byte controls are used in Unnumbered Information frames.
|
|
||||||
* Two byte controls are used in Numbered Information frames.
|
|
||||||
*/
|
|
||||||
#define IS_UI 0x03
|
|
||||||
|
|
||||||
#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
|
|
||||||
|
|
||||||
/* ui has one byte ctrl, ni has two */
|
|
||||||
struct hdr_ui {
|
|
||||||
__u8 dsap;
|
|
||||||
__u8 ssap;
|
|
||||||
__u8 ctrl;
|
|
||||||
__u8 orig[3];
|
|
||||||
__be16 type;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct hdr_ni {
|
|
||||||
__u8 dsap;
|
|
||||||
__u8 ssap;
|
|
||||||
__be16 ctrl;
|
|
||||||
__u8 orig[3];
|
|
||||||
__be16 type;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ebt_802_3_hdr {
|
|
||||||
__u8 daddr[6];
|
|
||||||
__u8 saddr[6];
|
|
||||||
__be16 len;
|
|
||||||
union {
|
|
||||||
struct hdr_ui ui;
|
|
||||||
struct hdr_ni ni;
|
|
||||||
} llc;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
|
#include <uapi/linux/netfilter_bridge/ebt_802_3.h>
|
||||||
|
|
||||||
static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
|
static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
return (struct ebt_802_3_hdr *)skb_mac_header(skb);
|
return (struct ebt_802_3_hdr *)skb_mac_header(skb);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct ebt_802_3_info {
|
|
||||||
__u8 sap;
|
|
||||||
__be16 type;
|
|
||||||
__u8 bitmask;
|
|
||||||
__u8 invflags;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -9,191 +9,11 @@
|
||||||
* This code is stongly inspired on the iptables code which is
|
* This code is stongly inspired on the iptables code which is
|
||||||
* Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
|
* Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __LINUX_BRIDGE_EFF_H
|
#ifndef __LINUX_BRIDGE_EFF_H
|
||||||
#define __LINUX_BRIDGE_EFF_H
|
#define __LINUX_BRIDGE_EFF_H
|
||||||
#include <linux/if.h>
|
|
||||||
#include <linux/netfilter_bridge.h>
|
|
||||||
#include <linux/if_ether.h>
|
|
||||||
|
|
||||||
#define EBT_TABLE_MAXNAMELEN 32
|
#include <uapi/linux/netfilter_bridge/ebtables.h>
|
||||||
#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
|
|
||||||
#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
|
|
||||||
|
|
||||||
/* verdicts >0 are "branches" */
|
|
||||||
#define EBT_ACCEPT -1
|
|
||||||
#define EBT_DROP -2
|
|
||||||
#define EBT_CONTINUE -3
|
|
||||||
#define EBT_RETURN -4
|
|
||||||
#define NUM_STANDARD_TARGETS 4
|
|
||||||
/* ebtables target modules store the verdict inside an int. We can
|
|
||||||
* reclaim a part of this int for backwards compatible extensions.
|
|
||||||
* The 4 lsb are more than enough to store the verdict. */
|
|
||||||
#define EBT_VERDICT_BITS 0x0000000F
|
|
||||||
|
|
||||||
struct xt_match;
|
|
||||||
struct xt_target;
|
|
||||||
|
|
||||||
struct ebt_counter {
|
|
||||||
uint64_t pcnt;
|
|
||||||
uint64_t bcnt;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ebt_replace {
|
|
||||||
char name[EBT_TABLE_MAXNAMELEN];
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
/* nr of rules in the table */
|
|
||||||
unsigned int nentries;
|
|
||||||
/* total size of the entries */
|
|
||||||
unsigned int entries_size;
|
|
||||||
/* start of the chains */
|
|
||||||
struct ebt_entries __user *hook_entry[NF_BR_NUMHOOKS];
|
|
||||||
/* nr of counters userspace expects back */
|
|
||||||
unsigned int num_counters;
|
|
||||||
/* where the kernel will put the old counters */
|
|
||||||
struct ebt_counter __user *counters;
|
|
||||||
char __user *entries;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ebt_replace_kernel {
|
|
||||||
char name[EBT_TABLE_MAXNAMELEN];
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
/* nr of rules in the table */
|
|
||||||
unsigned int nentries;
|
|
||||||
/* total size of the entries */
|
|
||||||
unsigned int entries_size;
|
|
||||||
/* start of the chains */
|
|
||||||
struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
|
|
||||||
/* nr of counters userspace expects back */
|
|
||||||
unsigned int num_counters;
|
|
||||||
/* where the kernel will put the old counters */
|
|
||||||
struct ebt_counter *counters;
|
|
||||||
char *entries;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ebt_entries {
|
|
||||||
/* this field is always set to zero
|
|
||||||
* See EBT_ENTRY_OR_ENTRIES.
|
|
||||||
* Must be same size as ebt_entry.bitmask */
|
|
||||||
unsigned int distinguisher;
|
|
||||||
/* the chain name */
|
|
||||||
char name[EBT_CHAIN_MAXNAMELEN];
|
|
||||||
/* counter offset for this chain */
|
|
||||||
unsigned int counter_offset;
|
|
||||||
/* one standard (accept, drop, return) per hook */
|
|
||||||
int policy;
|
|
||||||
/* nr. of entries */
|
|
||||||
unsigned int nentries;
|
|
||||||
/* entry list */
|
|
||||||
char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
|
||||||
};
|
|
||||||
|
|
||||||
/* used for the bitmask of struct ebt_entry */
|
|
||||||
|
|
||||||
/* This is a hack to make a difference between an ebt_entry struct and an
|
|
||||||
* ebt_entries struct when traversing the entries from start to end.
|
|
||||||
* Using this simplifies the code a lot, while still being able to use
|
|
||||||
* ebt_entries.
|
|
||||||
* Contrary, iptables doesn't use something like ebt_entries and therefore uses
|
|
||||||
* different techniques for naming the policy and such. So, iptables doesn't
|
|
||||||
* need a hack like this.
|
|
||||||
*/
|
|
||||||
#define EBT_ENTRY_OR_ENTRIES 0x01
|
|
||||||
/* these are the normal masks */
|
|
||||||
#define EBT_NOPROTO 0x02
|
|
||||||
#define EBT_802_3 0x04
|
|
||||||
#define EBT_SOURCEMAC 0x08
|
|
||||||
#define EBT_DESTMAC 0x10
|
|
||||||
#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
|
|
||||||
| EBT_ENTRY_OR_ENTRIES)
|
|
||||||
|
|
||||||
#define EBT_IPROTO 0x01
|
|
||||||
#define EBT_IIN 0x02
|
|
||||||
#define EBT_IOUT 0x04
|
|
||||||
#define EBT_ISOURCE 0x8
|
|
||||||
#define EBT_IDEST 0x10
|
|
||||||
#define EBT_ILOGICALIN 0x20
|
|
||||||
#define EBT_ILOGICALOUT 0x40
|
|
||||||
#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
|
|
||||||
| EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
|
|
||||||
|
|
||||||
struct ebt_entry_match {
|
|
||||||
union {
|
|
||||||
char name[EBT_FUNCTION_MAXNAMELEN];
|
|
||||||
struct xt_match *match;
|
|
||||||
} u;
|
|
||||||
/* size of data */
|
|
||||||
unsigned int match_size;
|
|
||||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ebt_entry_watcher {
|
|
||||||
union {
|
|
||||||
char name[EBT_FUNCTION_MAXNAMELEN];
|
|
||||||
struct xt_target *watcher;
|
|
||||||
} u;
|
|
||||||
/* size of data */
|
|
||||||
unsigned int watcher_size;
|
|
||||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ebt_entry_target {
|
|
||||||
union {
|
|
||||||
char name[EBT_FUNCTION_MAXNAMELEN];
|
|
||||||
struct xt_target *target;
|
|
||||||
} u;
|
|
||||||
/* size of data */
|
|
||||||
unsigned int target_size;
|
|
||||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
|
||||||
};
|
|
||||||
|
|
||||||
#define EBT_STANDARD_TARGET "standard"
|
|
||||||
struct ebt_standard_target {
|
|
||||||
struct ebt_entry_target target;
|
|
||||||
int verdict;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* one entry */
|
|
||||||
struct ebt_entry {
|
|
||||||
/* this needs to be the first field */
|
|
||||||
unsigned int bitmask;
|
|
||||||
unsigned int invflags;
|
|
||||||
__be16 ethproto;
|
|
||||||
/* the physical in-dev */
|
|
||||||
char in[IFNAMSIZ];
|
|
||||||
/* the logical in-dev */
|
|
||||||
char logical_in[IFNAMSIZ];
|
|
||||||
/* the physical out-dev */
|
|
||||||
char out[IFNAMSIZ];
|
|
||||||
/* the logical out-dev */
|
|
||||||
char logical_out[IFNAMSIZ];
|
|
||||||
unsigned char sourcemac[ETH_ALEN];
|
|
||||||
unsigned char sourcemsk[ETH_ALEN];
|
|
||||||
unsigned char destmac[ETH_ALEN];
|
|
||||||
unsigned char destmsk[ETH_ALEN];
|
|
||||||
/* sizeof ebt_entry + matches */
|
|
||||||
unsigned int watchers_offset;
|
|
||||||
/* sizeof ebt_entry + matches + watchers */
|
|
||||||
unsigned int target_offset;
|
|
||||||
/* sizeof ebt_entry + matches + watchers + target */
|
|
||||||
unsigned int next_offset;
|
|
||||||
unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
|
||||||
};
|
|
||||||
|
|
||||||
/* {g,s}etsockopt numbers */
|
|
||||||
#define EBT_BASE_CTL 128
|
|
||||||
|
|
||||||
#define EBT_SO_SET_ENTRIES (EBT_BASE_CTL)
|
|
||||||
#define EBT_SO_SET_COUNTERS (EBT_SO_SET_ENTRIES+1)
|
|
||||||
#define EBT_SO_SET_MAX (EBT_SO_SET_COUNTERS+1)
|
|
||||||
|
|
||||||
#define EBT_SO_GET_INFO (EBT_BASE_CTL)
|
|
||||||
#define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO+1)
|
|
||||||
#define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES+1)
|
|
||||||
#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
|
|
||||||
#define EBT_SO_GET_MAX (EBT_SO_GET_INIT_ENTRIES+1)
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
/* return values for match() functions */
|
/* return values for match() functions */
|
||||||
#define EBT_MATCH 0
|
#define EBT_MATCH 0
|
||||||
|
@ -304,77 +124,4 @@ extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
|
||||||
/* True if the target is not a standard target */
|
/* True if the target is not a standard target */
|
||||||
#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
|
#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
/* blatently stolen from ip_tables.h
|
|
||||||
* fn returns 0 to continue iteration */
|
|
||||||
#define EBT_MATCH_ITERATE(e, fn, args...) \
|
|
||||||
({ \
|
|
||||||
unsigned int __i; \
|
|
||||||
int __ret = 0; \
|
|
||||||
struct ebt_entry_match *__match; \
|
|
||||||
\
|
|
||||||
for (__i = sizeof(struct ebt_entry); \
|
|
||||||
__i < (e)->watchers_offset; \
|
|
||||||
__i += __match->match_size + \
|
|
||||||
sizeof(struct ebt_entry_match)) { \
|
|
||||||
__match = (void *)(e) + __i; \
|
|
||||||
\
|
|
||||||
__ret = fn(__match , ## args); \
|
|
||||||
if (__ret != 0) \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
if (__ret == 0) { \
|
|
||||||
if (__i != (e)->watchers_offset) \
|
|
||||||
__ret = -EINVAL; \
|
|
||||||
} \
|
|
||||||
__ret; \
|
|
||||||
})
|
|
||||||
|
|
||||||
#define EBT_WATCHER_ITERATE(e, fn, args...) \
|
|
||||||
({ \
|
|
||||||
unsigned int __i; \
|
|
||||||
int __ret = 0; \
|
|
||||||
struct ebt_entry_watcher *__watcher; \
|
|
||||||
\
|
|
||||||
for (__i = e->watchers_offset; \
|
|
||||||
__i < (e)->target_offset; \
|
|
||||||
__i += __watcher->watcher_size + \
|
|
||||||
sizeof(struct ebt_entry_watcher)) { \
|
|
||||||
__watcher = (void *)(e) + __i; \
|
|
||||||
\
|
|
||||||
__ret = fn(__watcher , ## args); \
|
|
||||||
if (__ret != 0) \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
if (__ret == 0) { \
|
|
||||||
if (__i != (e)->target_offset) \
|
|
||||||
__ret = -EINVAL; \
|
|
||||||
} \
|
|
||||||
__ret; \
|
|
||||||
})
|
|
||||||
|
|
||||||
#define EBT_ENTRY_ITERATE(entries, size, fn, args...) \
|
|
||||||
({ \
|
|
||||||
unsigned int __i; \
|
|
||||||
int __ret = 0; \
|
|
||||||
struct ebt_entry *__entry; \
|
|
||||||
\
|
|
||||||
for (__i = 0; __i < (size);) { \
|
|
||||||
__entry = (void *)(entries) + __i; \
|
|
||||||
__ret = fn(__entry , ## args); \
|
|
||||||
if (__ret != 0) \
|
|
||||||
break; \
|
|
||||||
if (__entry->bitmask != 0) \
|
|
||||||
__i += __entry->next_offset; \
|
|
||||||
else \
|
|
||||||
__i += sizeof(struct ebt_entries); \
|
|
||||||
} \
|
|
||||||
if (__ret == 0) { \
|
|
||||||
if (__i != (size)) \
|
|
||||||
__ret = -EINVAL; \
|
|
||||||
} \
|
|
||||||
__ret; \
|
|
||||||
})
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
header-y += ip_tables.h
|
|
||||||
header-y += ipt_CLUSTERIP.h
|
|
||||||
header-y += ipt_ECN.h
|
|
||||||
header-y += ipt_LOG.h
|
|
||||||
header-y += ipt_REJECT.h
|
|
||||||
header-y += ipt_TTL.h
|
|
||||||
header-y += ipt_ULOG.h
|
|
||||||
header-y += ipt_ah.h
|
|
||||||
header-y += ipt_ecn.h
|
|
||||||
header-y += ipt_ttl.h
|
|
|
@ -11,230 +11,17 @@
|
||||||
* flags are stored in host byte order (of course).
|
* flags are stored in host byte order (of course).
|
||||||
* Port numbers are stored in HOST byte order.
|
* Port numbers are stored in HOST byte order.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IPTABLES_H
|
#ifndef _IPTABLES_H
|
||||||
#define _IPTABLES_H
|
#define _IPTABLES_H
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
#include <linux/in.h>
|
#include <linux/in.h>
|
||||||
#include <linux/ip.h>
|
#include <linux/ip.h>
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
#endif
|
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/compiler.h>
|
|
||||||
#include <linux/netfilter_ipv4.h>
|
|
||||||
|
|
||||||
#include <linux/netfilter/x_tables.h>
|
|
||||||
|
|
||||||
#ifndef __KERNEL__
|
|
||||||
#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
|
|
||||||
#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
|
|
||||||
#define ipt_match xt_match
|
|
||||||
#define ipt_target xt_target
|
|
||||||
#define ipt_table xt_table
|
|
||||||
#define ipt_get_revision xt_get_revision
|
|
||||||
#define ipt_entry_match xt_entry_match
|
|
||||||
#define ipt_entry_target xt_entry_target
|
|
||||||
#define ipt_standard_target xt_standard_target
|
|
||||||
#define ipt_error_target xt_error_target
|
|
||||||
#define ipt_counters xt_counters
|
|
||||||
#define IPT_CONTINUE XT_CONTINUE
|
|
||||||
#define IPT_RETURN XT_RETURN
|
|
||||||
|
|
||||||
/* This group is older than old (iptables < v1.4.0-rc1~89) */
|
|
||||||
#include <linux/netfilter/xt_tcpudp.h>
|
|
||||||
#define ipt_udp xt_udp
|
|
||||||
#define ipt_tcp xt_tcp
|
|
||||||
#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
|
|
||||||
#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
|
|
||||||
#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
|
|
||||||
#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
|
|
||||||
#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
|
|
||||||
#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
|
|
||||||
#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
|
|
||||||
#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
|
|
||||||
|
|
||||||
/* The argument to IPT_SO_ADD_COUNTERS. */
|
|
||||||
#define ipt_counters_info xt_counters_info
|
|
||||||
/* Standard return verdict, or do jump. */
|
|
||||||
#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
|
|
||||||
/* Error verdict. */
|
|
||||||
#define IPT_ERROR_TARGET XT_ERROR_TARGET
|
|
||||||
|
|
||||||
/* fn returns 0 to continue iteration */
|
|
||||||
#define IPT_MATCH_ITERATE(e, fn, args...) \
|
|
||||||
XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
|
|
||||||
|
|
||||||
/* fn returns 0 to continue iteration */
|
|
||||||
#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
|
|
||||||
XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Yes, Virginia, you have to zero the padding. */
|
|
||||||
struct ipt_ip {
|
|
||||||
/* Source and destination IP addr */
|
|
||||||
struct in_addr src, dst;
|
|
||||||
/* Mask for src and dest IP addr */
|
|
||||||
struct in_addr smsk, dmsk;
|
|
||||||
char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
|
|
||||||
unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
|
|
||||||
|
|
||||||
/* Protocol, 0 = ANY */
|
|
||||||
__u16 proto;
|
|
||||||
|
|
||||||
/* Flags word */
|
|
||||||
__u8 flags;
|
|
||||||
/* Inverse flags */
|
|
||||||
__u8 invflags;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Values for "flag" field in struct ipt_ip (general ip structure). */
|
|
||||||
#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
|
|
||||||
#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
|
|
||||||
#define IPT_F_MASK 0x03 /* All possible flag bits mask. */
|
|
||||||
|
|
||||||
/* Values for "inv" field in struct ipt_ip. */
|
|
||||||
#define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
|
|
||||||
#define IPT_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
|
|
||||||
#define IPT_INV_TOS 0x04 /* Invert the sense of TOS. */
|
|
||||||
#define IPT_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
|
|
||||||
#define IPT_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
|
|
||||||
#define IPT_INV_FRAG 0x20 /* Invert the sense of FRAG. */
|
|
||||||
#define IPT_INV_PROTO XT_INV_PROTO
|
|
||||||
#define IPT_INV_MASK 0x7F /* All possible flag bits mask. */
|
|
||||||
|
|
||||||
/* This structure defines each of the firewall rules. Consists of 3
|
|
||||||
parts which are 1) general IP header stuff 2) match specific
|
|
||||||
stuff 3) the target to perform if the rule matches */
|
|
||||||
struct ipt_entry {
|
|
||||||
struct ipt_ip ip;
|
|
||||||
|
|
||||||
/* Mark with fields that we care about. */
|
|
||||||
unsigned int nfcache;
|
|
||||||
|
|
||||||
/* Size of ipt_entry + matches */
|
|
||||||
__u16 target_offset;
|
|
||||||
/* Size of ipt_entry + matches + target */
|
|
||||||
__u16 next_offset;
|
|
||||||
|
|
||||||
/* Back pointer */
|
|
||||||
unsigned int comefrom;
|
|
||||||
|
|
||||||
/* Packet and byte counters. */
|
|
||||||
struct xt_counters counters;
|
|
||||||
|
|
||||||
/* The matches (if any), then the target. */
|
|
||||||
unsigned char elems[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* New IP firewall options for [gs]etsockopt at the RAW IP level.
|
|
||||||
* Unlike BSD Linux inherits IP options so you don't have to use a raw
|
|
||||||
* socket for this. Instead we check rights in the calls.
|
|
||||||
*
|
|
||||||
* ATTENTION: check linux/in.h before adding new number here.
|
|
||||||
*/
|
|
||||||
#define IPT_BASE_CTL 64
|
|
||||||
|
|
||||||
#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
|
|
||||||
#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
|
|
||||||
#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
|
|
||||||
|
|
||||||
#define IPT_SO_GET_INFO (IPT_BASE_CTL)
|
|
||||||
#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
|
|
||||||
#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
|
|
||||||
#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
|
|
||||||
#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
|
|
||||||
|
|
||||||
/* ICMP matching stuff */
|
|
||||||
struct ipt_icmp {
|
|
||||||
__u8 type; /* type to match */
|
|
||||||
__u8 code[2]; /* range of code */
|
|
||||||
__u8 invflags; /* Inverse flags */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Values for "inv" field for struct ipt_icmp. */
|
|
||||||
#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
|
|
||||||
|
|
||||||
/* The argument to IPT_SO_GET_INFO */
|
|
||||||
struct ipt_getinfo {
|
|
||||||
/* Which table: caller fills this in. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* Kernel fills these in. */
|
|
||||||
/* Which hook entry points are valid: bitmask */
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
|
|
||||||
/* Hook entry points: one per netfilter hook. */
|
|
||||||
unsigned int hook_entry[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Underflow points. */
|
|
||||||
unsigned int underflow[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Number of entries */
|
|
||||||
unsigned int num_entries;
|
|
||||||
|
|
||||||
/* Size of entries. */
|
|
||||||
unsigned int size;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to IPT_SO_SET_REPLACE. */
|
|
||||||
struct ipt_replace {
|
|
||||||
/* Which table. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* Which hook entry points are valid: bitmask. You can't
|
|
||||||
change this. */
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
|
|
||||||
/* Number of entries */
|
|
||||||
unsigned int num_entries;
|
|
||||||
|
|
||||||
/* Total size of new entries */
|
|
||||||
unsigned int size;
|
|
||||||
|
|
||||||
/* Hook entry points. */
|
|
||||||
unsigned int hook_entry[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Underflow points. */
|
|
||||||
unsigned int underflow[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Information about old entries: */
|
|
||||||
/* Number of counters (must be equal to current number of entries). */
|
|
||||||
unsigned int num_counters;
|
|
||||||
/* The old entries' counters. */
|
|
||||||
struct xt_counters __user *counters;
|
|
||||||
|
|
||||||
/* The entries (hang off end: not really an array). */
|
|
||||||
struct ipt_entry entries[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to IPT_SO_GET_ENTRIES. */
|
|
||||||
struct ipt_get_entries {
|
|
||||||
/* Which table: user fills this in. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* User fills this in: total entry size. */
|
|
||||||
unsigned int size;
|
|
||||||
|
|
||||||
/* The entries. */
|
|
||||||
struct ipt_entry entrytable[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Helper functions */
|
|
||||||
static __inline__ struct xt_entry_target *
|
|
||||||
ipt_get_target(struct ipt_entry *e)
|
|
||||||
{
|
|
||||||
return (void *)e + e->target_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main firewall chains definitions and global var's definitions.
|
|
||||||
*/
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
#include <uapi/linux/netfilter_ipv4/ip_tables.h>
|
||||||
|
|
||||||
extern void ipt_init(void) __init;
|
extern void ipt_init(void) __init;
|
||||||
|
|
||||||
extern struct xt_table *ipt_register_table(struct net *net,
|
extern struct xt_table *ipt_register_table(struct net *net,
|
||||||
|
@ -303,5 +90,4 @@ compat_ipt_get_target(struct compat_ipt_entry *e)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_COMPAT */
|
#endif /* CONFIG_COMPAT */
|
||||||
#endif /*__KERNEL__*/
|
|
||||||
#endif /* _IPTABLES_H */
|
#endif /* _IPTABLES_H */
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
header-y += ip6_tables.h
|
|
||||||
header-y += ip6t_HL.h
|
|
||||||
header-y += ip6t_LOG.h
|
|
||||||
header-y += ip6t_NPT.h
|
|
||||||
header-y += ip6t_REJECT.h
|
|
||||||
header-y += ip6t_ah.h
|
|
||||||
header-y += ip6t_frag.h
|
|
||||||
header-y += ip6t_hl.h
|
|
||||||
header-y += ip6t_ipv6header.h
|
|
||||||
header-y += ip6t_mh.h
|
|
||||||
header-y += ip6t_opts.h
|
|
||||||
header-y += ip6t_rt.h
|
|
|
@ -11,268 +11,17 @@
|
||||||
* flags are stored in host byte order (of course).
|
* flags are stored in host byte order (of course).
|
||||||
* Port numbers are stored in HOST byte order.
|
* Port numbers are stored in HOST byte order.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IP6_TABLES_H
|
#ifndef _IP6_TABLES_H
|
||||||
#define _IP6_TABLES_H
|
#define _IP6_TABLES_H
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
#include <linux/in6.h>
|
#include <linux/in6.h>
|
||||||
#include <linux/ipv6.h>
|
#include <linux/ipv6.h>
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
#endif
|
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/compiler.h>
|
|
||||||
#include <linux/netfilter_ipv6.h>
|
|
||||||
|
|
||||||
#include <linux/netfilter/x_tables.h>
|
|
||||||
|
|
||||||
#ifndef __KERNEL__
|
|
||||||
#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
|
|
||||||
#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
|
|
||||||
#define ip6t_match xt_match
|
|
||||||
#define ip6t_target xt_target
|
|
||||||
#define ip6t_table xt_table
|
|
||||||
#define ip6t_get_revision xt_get_revision
|
|
||||||
#define ip6t_entry_match xt_entry_match
|
|
||||||
#define ip6t_entry_target xt_entry_target
|
|
||||||
#define ip6t_standard_target xt_standard_target
|
|
||||||
#define ip6t_error_target xt_error_target
|
|
||||||
#define ip6t_counters xt_counters
|
|
||||||
#define IP6T_CONTINUE XT_CONTINUE
|
|
||||||
#define IP6T_RETURN XT_RETURN
|
|
||||||
|
|
||||||
/* Pre-iptables-1.4.0 */
|
|
||||||
#include <linux/netfilter/xt_tcpudp.h>
|
|
||||||
#define ip6t_tcp xt_tcp
|
|
||||||
#define ip6t_udp xt_udp
|
|
||||||
#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
|
|
||||||
#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
|
|
||||||
#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
|
|
||||||
#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
|
|
||||||
#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
|
|
||||||
#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
|
|
||||||
#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
|
|
||||||
#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
|
|
||||||
|
|
||||||
#define ip6t_counters_info xt_counters_info
|
|
||||||
#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
|
|
||||||
#define IP6T_ERROR_TARGET XT_ERROR_TARGET
|
|
||||||
#define IP6T_MATCH_ITERATE(e, fn, args...) \
|
|
||||||
XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
|
|
||||||
#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
|
|
||||||
XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Yes, Virginia, you have to zero the padding. */
|
|
||||||
struct ip6t_ip6 {
|
|
||||||
/* Source and destination IP6 addr */
|
|
||||||
struct in6_addr src, dst;
|
|
||||||
/* Mask for src and dest IP6 addr */
|
|
||||||
struct in6_addr smsk, dmsk;
|
|
||||||
char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
|
|
||||||
unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
|
|
||||||
|
|
||||||
/* Upper protocol number
|
|
||||||
* - The allowed value is 0 (any) or protocol number of last parsable
|
|
||||||
* header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
|
|
||||||
* the non IPv6 extension headers.
|
|
||||||
* - The protocol numbers of IPv6 extension headers except of ESP and
|
|
||||||
* MH do not match any packets.
|
|
||||||
* - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
|
|
||||||
*/
|
|
||||||
__u16 proto;
|
|
||||||
/* TOS to match iff flags & IP6T_F_TOS */
|
|
||||||
__u8 tos;
|
|
||||||
|
|
||||||
/* Flags word */
|
|
||||||
__u8 flags;
|
|
||||||
/* Inverse flags */
|
|
||||||
__u8 invflags;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
|
|
||||||
#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
|
|
||||||
protocols */
|
|
||||||
#define IP6T_F_TOS 0x02 /* Match the TOS. */
|
|
||||||
#define IP6T_F_GOTO 0x04 /* Set if jump is a goto */
|
|
||||||
#define IP6T_F_MASK 0x07 /* All possible flag bits mask. */
|
|
||||||
|
|
||||||
/* Values for "inv" field in struct ip6t_ip6. */
|
|
||||||
#define IP6T_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
|
|
||||||
#define IP6T_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
|
|
||||||
#define IP6T_INV_TOS 0x04 /* Invert the sense of TOS. */
|
|
||||||
#define IP6T_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
|
|
||||||
#define IP6T_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
|
|
||||||
#define IP6T_INV_FRAG 0x20 /* Invert the sense of FRAG. */
|
|
||||||
#define IP6T_INV_PROTO XT_INV_PROTO
|
|
||||||
#define IP6T_INV_MASK 0x7F /* All possible flag bits mask. */
|
|
||||||
|
|
||||||
/* This structure defines each of the firewall rules. Consists of 3
|
|
||||||
parts which are 1) general IP header stuff 2) match specific
|
|
||||||
stuff 3) the target to perform if the rule matches */
|
|
||||||
struct ip6t_entry {
|
|
||||||
struct ip6t_ip6 ipv6;
|
|
||||||
|
|
||||||
/* Mark with fields that we care about. */
|
|
||||||
unsigned int nfcache;
|
|
||||||
|
|
||||||
/* Size of ipt_entry + matches */
|
|
||||||
__u16 target_offset;
|
|
||||||
/* Size of ipt_entry + matches + target */
|
|
||||||
__u16 next_offset;
|
|
||||||
|
|
||||||
/* Back pointer */
|
|
||||||
unsigned int comefrom;
|
|
||||||
|
|
||||||
/* Packet and byte counters. */
|
|
||||||
struct xt_counters counters;
|
|
||||||
|
|
||||||
/* The matches (if any), then the target. */
|
|
||||||
unsigned char elems[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Standard entry */
|
|
||||||
struct ip6t_standard {
|
|
||||||
struct ip6t_entry entry;
|
|
||||||
struct xt_standard_target target;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ip6t_error {
|
|
||||||
struct ip6t_entry entry;
|
|
||||||
struct xt_error_target target;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define IP6T_ENTRY_INIT(__size) \
|
|
||||||
{ \
|
|
||||||
.target_offset = sizeof(struct ip6t_entry), \
|
|
||||||
.next_offset = (__size), \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define IP6T_STANDARD_INIT(__verdict) \
|
|
||||||
{ \
|
|
||||||
.entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \
|
|
||||||
.target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
|
|
||||||
sizeof(struct xt_standard_target)), \
|
|
||||||
.target.verdict = -(__verdict) - 1, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define IP6T_ERROR_INIT \
|
|
||||||
{ \
|
|
||||||
.entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \
|
|
||||||
.target = XT_TARGET_INIT(XT_ERROR_TARGET, \
|
|
||||||
sizeof(struct xt_error_target)), \
|
|
||||||
.target.errorname = "ERROR", \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* New IP firewall options for [gs]etsockopt at the RAW IP level.
|
|
||||||
* Unlike BSD Linux inherits IP options so you don't have to use
|
|
||||||
* a raw socket for this. Instead we check rights in the calls.
|
|
||||||
*
|
|
||||||
* ATTENTION: check linux/in6.h before adding new number here.
|
|
||||||
*/
|
|
||||||
#define IP6T_BASE_CTL 64
|
|
||||||
|
|
||||||
#define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
|
|
||||||
#define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
|
|
||||||
#define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
|
|
||||||
|
|
||||||
#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
|
|
||||||
#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
|
|
||||||
#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
|
|
||||||
#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
|
|
||||||
#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
|
|
||||||
|
|
||||||
/* ICMP matching stuff */
|
|
||||||
struct ip6t_icmp {
|
|
||||||
__u8 type; /* type to match */
|
|
||||||
__u8 code[2]; /* range of code */
|
|
||||||
__u8 invflags; /* Inverse flags */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Values for "inv" field for struct ipt_icmp. */
|
|
||||||
#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */
|
|
||||||
|
|
||||||
/* The argument to IP6T_SO_GET_INFO */
|
|
||||||
struct ip6t_getinfo {
|
|
||||||
/* Which table: caller fills this in. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* Kernel fills these in. */
|
|
||||||
/* Which hook entry points are valid: bitmask */
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
|
|
||||||
/* Hook entry points: one per netfilter hook. */
|
|
||||||
unsigned int hook_entry[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Underflow points. */
|
|
||||||
unsigned int underflow[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Number of entries */
|
|
||||||
unsigned int num_entries;
|
|
||||||
|
|
||||||
/* Size of entries. */
|
|
||||||
unsigned int size;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to IP6T_SO_SET_REPLACE. */
|
|
||||||
struct ip6t_replace {
|
|
||||||
/* Which table. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* Which hook entry points are valid: bitmask. You can't
|
|
||||||
change this. */
|
|
||||||
unsigned int valid_hooks;
|
|
||||||
|
|
||||||
/* Number of entries */
|
|
||||||
unsigned int num_entries;
|
|
||||||
|
|
||||||
/* Total size of new entries */
|
|
||||||
unsigned int size;
|
|
||||||
|
|
||||||
/* Hook entry points. */
|
|
||||||
unsigned int hook_entry[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Underflow points. */
|
|
||||||
unsigned int underflow[NF_INET_NUMHOOKS];
|
|
||||||
|
|
||||||
/* Information about old entries: */
|
|
||||||
/* Number of counters (must be equal to current number of entries). */
|
|
||||||
unsigned int num_counters;
|
|
||||||
/* The old entries' counters. */
|
|
||||||
struct xt_counters __user *counters;
|
|
||||||
|
|
||||||
/* The entries (hang off end: not really an array). */
|
|
||||||
struct ip6t_entry entries[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The argument to IP6T_SO_GET_ENTRIES. */
|
|
||||||
struct ip6t_get_entries {
|
|
||||||
/* Which table: user fills this in. */
|
|
||||||
char name[XT_TABLE_MAXNAMELEN];
|
|
||||||
|
|
||||||
/* User fills this in: total entry size. */
|
|
||||||
unsigned int size;
|
|
||||||
|
|
||||||
/* The entries. */
|
|
||||||
struct ip6t_entry entrytable[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Helper functions */
|
|
||||||
static __inline__ struct xt_entry_target *
|
|
||||||
ip6t_get_target(struct ip6t_entry *e)
|
|
||||||
{
|
|
||||||
return (void *)e + e->target_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main firewall chains definitions and global var's definitions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
#include <uapi/linux/netfilter_ipv6/ip6_tables.h>
|
||||||
|
|
||||||
extern void ip6t_init(void) __init;
|
extern void ip6t_init(void) __init;
|
||||||
|
|
||||||
extern void *ip6t_alloc_initial_table(const struct xt_table *);
|
extern void *ip6t_alloc_initial_table(const struct xt_table *);
|
||||||
|
@ -327,5 +76,4 @@ compat_ip6t_get_target(struct compat_ip6t_entry *e)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_COMPAT */
|
#endif /* CONFIG_COMPAT */
|
||||||
#endif /*__KERNEL__*/
|
|
||||||
#endif /* _IP6_TABLES_H */
|
#endif /* _IP6_TABLES_H */
|
||||||
|
|
|
@ -245,6 +245,8 @@ struct netlink_callback {
|
||||||
struct netlink_callback *cb);
|
struct netlink_callback *cb);
|
||||||
int (*done)(struct netlink_callback *cb);
|
int (*done)(struct netlink_callback *cb);
|
||||||
void *data;
|
void *data;
|
||||||
|
/* the module that dump function belong to */
|
||||||
|
struct module *module;
|
||||||
u16 family;
|
u16 family;
|
||||||
u16 min_dump_alloc;
|
u16 min_dump_alloc;
|
||||||
unsigned int prev_seq, seq;
|
unsigned int prev_seq, seq;
|
||||||
|
@ -262,14 +264,24 @@ __nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int fla
|
||||||
|
|
||||||
struct netlink_dump_control {
|
struct netlink_dump_control {
|
||||||
int (*dump)(struct sk_buff *skb, struct netlink_callback *);
|
int (*dump)(struct sk_buff *skb, struct netlink_callback *);
|
||||||
int (*done)(struct netlink_callback*);
|
int (*done)(struct netlink_callback *);
|
||||||
void *data;
|
void *data;
|
||||||
|
struct module *module;
|
||||||
u16 min_dump_alloc;
|
u16 min_dump_alloc;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
|
extern int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
|
||||||
const struct nlmsghdr *nlh,
|
const struct nlmsghdr *nlh,
|
||||||
struct netlink_dump_control *control);
|
struct netlink_dump_control *control);
|
||||||
|
static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
|
||||||
|
const struct nlmsghdr *nlh,
|
||||||
|
struct netlink_dump_control *control)
|
||||||
|
{
|
||||||
|
if (!control->module)
|
||||||
|
control->module = THIS_MODULE;
|
||||||
|
|
||||||
|
return __netlink_dump_start(ssk, skb, nlh, control);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
|
|
|
@ -589,9 +589,6 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
|
||||||
return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE);
|
return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void skb_recycle(struct sk_buff *skb);
|
|
||||||
extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
|
|
||||||
|
|
||||||
extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
|
extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
|
||||||
extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
|
extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
|
||||||
extern struct sk_buff *skb_clone(struct sk_buff *skb,
|
extern struct sk_buff *skb_clone(struct sk_buff *skb,
|
||||||
|
@ -2645,27 +2642,6 @@ static inline void skb_checksum_none_assert(const struct sk_buff *skb)
|
||||||
|
|
||||||
bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
|
bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
|
||||||
|
|
||||||
static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size)
|
|
||||||
{
|
|
||||||
if (irqs_disabled())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD);
|
|
||||||
if (skb_end_offset(skb) < skb_size)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (skb_shared(skb) || skb_cloned(skb))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* skb_head_is_locked - Determine if the skb->head is locked down
|
* skb_head_is_locked - Determine if the skb->head is locked down
|
||||||
* @skb: skb to check
|
* @skb: skb to check
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
header-y += tc_gact.h
|
|
||||||
header-y += tc_ipt.h
|
|
||||||
header-y += tc_mirred.h
|
|
||||||
header-y += tc_pedit.h
|
|
||||||
header-y += tc_nat.h
|
|
||||||
header-y += tc_skbedit.h
|
|
||||||
header-y += tc_csum.h
|
|
|
@ -1,4 +0,0 @@
|
||||||
header-y += tc_em_cmp.h
|
|
||||||
header-y += tc_em_meta.h
|
|
||||||
header-y += tc_em_nbyte.h
|
|
||||||
header-y += tc_em_text.h
|
|
|
@ -21,6 +21,7 @@ struct flowi_common {
|
||||||
__u8 flowic_flags;
|
__u8 flowic_flags;
|
||||||
#define FLOWI_FLAG_ANYSRC 0x01
|
#define FLOWI_FLAG_ANYSRC 0x01
|
||||||
#define FLOWI_FLAG_CAN_SLEEP 0x02
|
#define FLOWI_FLAG_CAN_SLEEP 0x02
|
||||||
|
#define FLOWI_FLAG_KNOWN_NH 0x04
|
||||||
__u32 flowic_secid;
|
__u32 flowic_secid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,8 @@ struct rtable {
|
||||||
int rt_genid;
|
int rt_genid;
|
||||||
unsigned int rt_flags;
|
unsigned int rt_flags;
|
||||||
__u16 rt_type;
|
__u16 rt_type;
|
||||||
__u16 rt_is_input;
|
__u8 rt_is_input;
|
||||||
|
__u8 rt_uses_gateway;
|
||||||
|
|
||||||
int rt_iif;
|
int rt_iif;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ struct rdma_cm_id_stats {
|
||||||
|
|
||||||
struct ibnl_client_cbs {
|
struct ibnl_client_cbs {
|
||||||
int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
|
int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
|
||||||
|
struct module *module;
|
||||||
};
|
};
|
||||||
|
|
||||||
int ibnl_init(void);
|
int ibnl_init(void);
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
# UAPI Header export list
|
# UAPI Header export list
|
||||||
|
header-y += caif_socket.h
|
||||||
|
header-y += if_caif.h
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
# UAPI Header export list
|
# UAPI Header export list
|
||||||
|
header-y += capicmd.h
|
||||||
|
|
|
@ -1,2 +1,78 @@
|
||||||
# UAPI Header export list
|
# UAPI Header export list
|
||||||
header-y += ipset/
|
header-y += ipset/
|
||||||
|
header-y += nf_conntrack_common.h
|
||||||
|
header-y += nf_conntrack_ftp.h
|
||||||
|
header-y += nf_conntrack_sctp.h
|
||||||
|
header-y += nf_conntrack_tcp.h
|
||||||
|
header-y += nf_conntrack_tuple_common.h
|
||||||
|
header-y += nf_nat.h
|
||||||
|
header-y += nfnetlink.h
|
||||||
|
header-y += nfnetlink_acct.h
|
||||||
|
header-y += nfnetlink_compat.h
|
||||||
|
header-y += nfnetlink_conntrack.h
|
||||||
|
header-y += nfnetlink_cthelper.h
|
||||||
|
header-y += nfnetlink_cttimeout.h
|
||||||
|
header-y += nfnetlink_log.h
|
||||||
|
header-y += nfnetlink_queue.h
|
||||||
|
header-y += x_tables.h
|
||||||
|
header-y += xt_AUDIT.h
|
||||||
|
header-y += xt_CHECKSUM.h
|
||||||
|
header-y += xt_CLASSIFY.h
|
||||||
|
header-y += xt_CONNMARK.h
|
||||||
|
header-y += xt_CONNSECMARK.h
|
||||||
|
header-y += xt_CT.h
|
||||||
|
header-y += xt_DSCP.h
|
||||||
|
header-y += xt_IDLETIMER.h
|
||||||
|
header-y += xt_LED.h
|
||||||
|
header-y += xt_LOG.h
|
||||||
|
header-y += xt_MARK.h
|
||||||
|
header-y += xt_NFLOG.h
|
||||||
|
header-y += xt_NFQUEUE.h
|
||||||
|
header-y += xt_RATEEST.h
|
||||||
|
header-y += xt_SECMARK.h
|
||||||
|
header-y += xt_TCPMSS.h
|
||||||
|
header-y += xt_TCPOPTSTRIP.h
|
||||||
|
header-y += xt_TEE.h
|
||||||
|
header-y += xt_TPROXY.h
|
||||||
|
header-y += xt_addrtype.h
|
||||||
|
header-y += xt_cluster.h
|
||||||
|
header-y += xt_comment.h
|
||||||
|
header-y += xt_connbytes.h
|
||||||
|
header-y += xt_connlimit.h
|
||||||
|
header-y += xt_connmark.h
|
||||||
|
header-y += xt_conntrack.h
|
||||||
|
header-y += xt_cpu.h
|
||||||
|
header-y += xt_dccp.h
|
||||||
|
header-y += xt_devgroup.h
|
||||||
|
header-y += xt_dscp.h
|
||||||
|
header-y += xt_ecn.h
|
||||||
|
header-y += xt_esp.h
|
||||||
|
header-y += xt_hashlimit.h
|
||||||
|
header-y += xt_helper.h
|
||||||
|
header-y += xt_iprange.h
|
||||||
|
header-y += xt_ipvs.h
|
||||||
|
header-y += xt_length.h
|
||||||
|
header-y += xt_limit.h
|
||||||
|
header-y += xt_mac.h
|
||||||
|
header-y += xt_mark.h
|
||||||
|
header-y += xt_multiport.h
|
||||||
|
header-y += xt_nfacct.h
|
||||||
|
header-y += xt_osf.h
|
||||||
|
header-y += xt_owner.h
|
||||||
|
header-y += xt_physdev.h
|
||||||
|
header-y += xt_pkttype.h
|
||||||
|
header-y += xt_policy.h
|
||||||
|
header-y += xt_quota.h
|
||||||
|
header-y += xt_rateest.h
|
||||||
|
header-y += xt_realm.h
|
||||||
|
header-y += xt_recent.h
|
||||||
|
header-y += xt_sctp.h
|
||||||
|
header-y += xt_set.h
|
||||||
|
header-y += xt_socket.h
|
||||||
|
header-y += xt_state.h
|
||||||
|
header-y += xt_statistic.h
|
||||||
|
header-y += xt_string.h
|
||||||
|
header-y += xt_tcpmss.h
|
||||||
|
header-y += xt_tcpudp.h
|
||||||
|
header-y += xt_time.h
|
||||||
|
header-y += xt_u32.h
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
# UAPI Header export list
|
# UAPI Header export list
|
||||||
|
header-y += ip_set.h
|
||||||
|
header-y += ip_set_bitmap.h
|
||||||
|
header-y += ip_set_hash.h
|
||||||
|
header-y += ip_set_list.h
|
||||||
|
|
231
include/uapi/linux/netfilter/ipset/ip_set.h
Normal file
231
include/uapi/linux/netfilter/ipset/ip_set.h
Normal file
|
@ -0,0 +1,231 @@
|
||||||
|
/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
|
||||||
|
* Patrick Schaaf <bof@bof.de>
|
||||||
|
* Martin Josefsson <gandalf@wlug.westbo.se>
|
||||||
|
* Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
#ifndef _UAPI_IP_SET_H
|
||||||
|
#define _UAPI_IP_SET_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
/* The protocol version */
|
||||||
|
#define IPSET_PROTOCOL 6
|
||||||
|
|
||||||
|
/* The max length of strings including NUL: set and type identifiers */
|
||||||
|
#define IPSET_MAXNAMELEN 32
|
||||||
|
|
||||||
|
/* Message types and commands */
|
||||||
|
enum ipset_cmd {
|
||||||
|
IPSET_CMD_NONE,
|
||||||
|
IPSET_CMD_PROTOCOL, /* 1: Return protocol version */
|
||||||
|
IPSET_CMD_CREATE, /* 2: Create a new (empty) set */
|
||||||
|
IPSET_CMD_DESTROY, /* 3: Destroy a (empty) set */
|
||||||
|
IPSET_CMD_FLUSH, /* 4: Remove all elements from a set */
|
||||||
|
IPSET_CMD_RENAME, /* 5: Rename a set */
|
||||||
|
IPSET_CMD_SWAP, /* 6: Swap two sets */
|
||||||
|
IPSET_CMD_LIST, /* 7: List sets */
|
||||||
|
IPSET_CMD_SAVE, /* 8: Save sets */
|
||||||
|
IPSET_CMD_ADD, /* 9: Add an element to a set */
|
||||||
|
IPSET_CMD_DEL, /* 10: Delete an element from a set */
|
||||||
|
IPSET_CMD_TEST, /* 11: Test an element in a set */
|
||||||
|
IPSET_CMD_HEADER, /* 12: Get set header data only */
|
||||||
|
IPSET_CMD_TYPE, /* 13: Get set type */
|
||||||
|
IPSET_MSG_MAX, /* Netlink message commands */
|
||||||
|
|
||||||
|
/* Commands in userspace: */
|
||||||
|
IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */
|
||||||
|
IPSET_CMD_HELP, /* 15: Get help */
|
||||||
|
IPSET_CMD_VERSION, /* 16: Get program version */
|
||||||
|
IPSET_CMD_QUIT, /* 17: Quit from interactive mode */
|
||||||
|
|
||||||
|
IPSET_CMD_MAX,
|
||||||
|
|
||||||
|
IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Attributes at command level */
|
||||||
|
enum {
|
||||||
|
IPSET_ATTR_UNSPEC,
|
||||||
|
IPSET_ATTR_PROTOCOL, /* 1: Protocol version */
|
||||||
|
IPSET_ATTR_SETNAME, /* 2: Name of the set */
|
||||||
|
IPSET_ATTR_TYPENAME, /* 3: Typename */
|
||||||
|
IPSET_ATTR_SETNAME2 = IPSET_ATTR_TYPENAME, /* Setname at rename/swap */
|
||||||
|
IPSET_ATTR_REVISION, /* 4: Settype revision */
|
||||||
|
IPSET_ATTR_FAMILY, /* 5: Settype family */
|
||||||
|
IPSET_ATTR_FLAGS, /* 6: Flags at command level */
|
||||||
|
IPSET_ATTR_DATA, /* 7: Nested attributes */
|
||||||
|
IPSET_ATTR_ADT, /* 8: Multiple data containers */
|
||||||
|
IPSET_ATTR_LINENO, /* 9: Restore lineno */
|
||||||
|
IPSET_ATTR_PROTOCOL_MIN, /* 10: Minimal supported version number */
|
||||||
|
IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN, /* type rev min */
|
||||||
|
__IPSET_ATTR_CMD_MAX,
|
||||||
|
};
|
||||||
|
#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
|
||||||
|
|
||||||
|
/* CADT specific attributes */
|
||||||
|
enum {
|
||||||
|
IPSET_ATTR_IP = IPSET_ATTR_UNSPEC + 1,
|
||||||
|
IPSET_ATTR_IP_FROM = IPSET_ATTR_IP,
|
||||||
|
IPSET_ATTR_IP_TO, /* 2 */
|
||||||
|
IPSET_ATTR_CIDR, /* 3 */
|
||||||
|
IPSET_ATTR_PORT, /* 4 */
|
||||||
|
IPSET_ATTR_PORT_FROM = IPSET_ATTR_PORT,
|
||||||
|
IPSET_ATTR_PORT_TO, /* 5 */
|
||||||
|
IPSET_ATTR_TIMEOUT, /* 6 */
|
||||||
|
IPSET_ATTR_PROTO, /* 7 */
|
||||||
|
IPSET_ATTR_CADT_FLAGS, /* 8 */
|
||||||
|
IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */
|
||||||
|
/* Reserve empty slots */
|
||||||
|
IPSET_ATTR_CADT_MAX = 16,
|
||||||
|
/* Create-only specific attributes */
|
||||||
|
IPSET_ATTR_GC,
|
||||||
|
IPSET_ATTR_HASHSIZE,
|
||||||
|
IPSET_ATTR_MAXELEM,
|
||||||
|
IPSET_ATTR_NETMASK,
|
||||||
|
IPSET_ATTR_PROBES,
|
||||||
|
IPSET_ATTR_RESIZE,
|
||||||
|
IPSET_ATTR_SIZE,
|
||||||
|
/* Kernel-only */
|
||||||
|
IPSET_ATTR_ELEMENTS,
|
||||||
|
IPSET_ATTR_REFERENCES,
|
||||||
|
IPSET_ATTR_MEMSIZE,
|
||||||
|
|
||||||
|
__IPSET_ATTR_CREATE_MAX,
|
||||||
|
};
|
||||||
|
#define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
|
||||||
|
|
||||||
|
/* ADT specific attributes */
|
||||||
|
enum {
|
||||||
|
IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
|
||||||
|
IPSET_ATTR_NAME,
|
||||||
|
IPSET_ATTR_NAMEREF,
|
||||||
|
IPSET_ATTR_IP2,
|
||||||
|
IPSET_ATTR_CIDR2,
|
||||||
|
IPSET_ATTR_IP2_TO,
|
||||||
|
IPSET_ATTR_IFACE,
|
||||||
|
__IPSET_ATTR_ADT_MAX,
|
||||||
|
};
|
||||||
|
#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
|
||||||
|
|
||||||
|
/* IP specific attributes */
|
||||||
|
enum {
|
||||||
|
IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
|
||||||
|
IPSET_ATTR_IPADDR_IPV6,
|
||||||
|
__IPSET_ATTR_IPADDR_MAX,
|
||||||
|
};
|
||||||
|
#define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
|
||||||
|
|
||||||
|
/* Error codes */
|
||||||
|
enum ipset_errno {
|
||||||
|
IPSET_ERR_PRIVATE = 4096,
|
||||||
|
IPSET_ERR_PROTOCOL,
|
||||||
|
IPSET_ERR_FIND_TYPE,
|
||||||
|
IPSET_ERR_MAX_SETS,
|
||||||
|
IPSET_ERR_BUSY,
|
||||||
|
IPSET_ERR_EXIST_SETNAME2,
|
||||||
|
IPSET_ERR_TYPE_MISMATCH,
|
||||||
|
IPSET_ERR_EXIST,
|
||||||
|
IPSET_ERR_INVALID_CIDR,
|
||||||
|
IPSET_ERR_INVALID_NETMASK,
|
||||||
|
IPSET_ERR_INVALID_FAMILY,
|
||||||
|
IPSET_ERR_TIMEOUT,
|
||||||
|
IPSET_ERR_REFERENCED,
|
||||||
|
IPSET_ERR_IPADDR_IPV4,
|
||||||
|
IPSET_ERR_IPADDR_IPV6,
|
||||||
|
|
||||||
|
/* Type specific error codes */
|
||||||
|
IPSET_ERR_TYPE_SPECIFIC = 4352,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Flags at command level */
|
||||||
|
enum ipset_cmd_flags {
|
||||||
|
IPSET_FLAG_BIT_EXIST = 0,
|
||||||
|
IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
|
||||||
|
IPSET_FLAG_BIT_LIST_SETNAME = 1,
|
||||||
|
IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
|
||||||
|
IPSET_FLAG_BIT_LIST_HEADER = 2,
|
||||||
|
IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
|
||||||
|
IPSET_FLAG_CMD_MAX = 15, /* Lower half */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Flags at CADT attribute level */
|
||||||
|
enum ipset_cadt_flags {
|
||||||
|
IPSET_FLAG_BIT_BEFORE = 0,
|
||||||
|
IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
|
||||||
|
IPSET_FLAG_BIT_PHYSDEV = 1,
|
||||||
|
IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
|
||||||
|
IPSET_FLAG_BIT_NOMATCH = 2,
|
||||||
|
IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
|
||||||
|
IPSET_FLAG_CADT_MAX = 15, /* Upper half */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Commands with settype-specific attributes */
|
||||||
|
enum ipset_adt {
|
||||||
|
IPSET_ADD,
|
||||||
|
IPSET_DEL,
|
||||||
|
IPSET_TEST,
|
||||||
|
IPSET_ADT_MAX,
|
||||||
|
IPSET_CREATE = IPSET_ADT_MAX,
|
||||||
|
IPSET_CADT_MAX,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
|
||||||
|
* and IPSET_INVALID_ID if you want to increase the max number of sets.
|
||||||
|
*/
|
||||||
|
typedef __u16 ip_set_id_t;
|
||||||
|
|
||||||
|
#define IPSET_INVALID_ID 65535
|
||||||
|
|
||||||
|
enum ip_set_dim {
|
||||||
|
IPSET_DIM_ZERO = 0,
|
||||||
|
IPSET_DIM_ONE,
|
||||||
|
IPSET_DIM_TWO,
|
||||||
|
IPSET_DIM_THREE,
|
||||||
|
/* Max dimension in elements.
|
||||||
|
* If changed, new revision of iptables match/target is required.
|
||||||
|
*/
|
||||||
|
IPSET_DIM_MAX = 6,
|
||||||
|
IPSET_BIT_RETURN_NOMATCH = 7,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Option flags for kernel operations */
|
||||||
|
enum ip_set_kopt {
|
||||||
|
IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
|
||||||
|
IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
|
||||||
|
IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
|
||||||
|
IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
|
||||||
|
IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* Interface to iptables/ip6tables */
|
||||||
|
|
||||||
|
#define SO_IP_SET 83
|
||||||
|
|
||||||
|
union ip_set_name_index {
|
||||||
|
char name[IPSET_MAXNAMELEN];
|
||||||
|
ip_set_id_t index;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define IP_SET_OP_GET_BYNAME 0x00000006 /* Get set index by name */
|
||||||
|
struct ip_set_req_get_set {
|
||||||
|
unsigned int op;
|
||||||
|
unsigned int version;
|
||||||
|
union ip_set_name_index set;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define IP_SET_OP_GET_BYINDEX 0x00000007 /* Get set name by index */
|
||||||
|
/* Uses ip_set_req_get_set */
|
||||||
|
|
||||||
|
#define IP_SET_OP_VERSION 0x00000100 /* Ask kernel version */
|
||||||
|
struct ip_set_req_version {
|
||||||
|
unsigned int op;
|
||||||
|
unsigned int version;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _UAPI_IP_SET_H */
|
13
include/uapi/linux/netfilter/ipset/ip_set_bitmap.h
Normal file
13
include/uapi/linux/netfilter/ipset/ip_set_bitmap.h
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#ifndef _UAPI__IP_SET_BITMAP_H
|
||||||
|
#define _UAPI__IP_SET_BITMAP_H
|
||||||
|
|
||||||
|
/* Bitmap type specific error codes */
|
||||||
|
enum {
|
||||||
|
/* The element is out of the range of the set */
|
||||||
|
IPSET_ERR_BITMAP_RANGE = IPSET_ERR_TYPE_SPECIFIC,
|
||||||
|
/* The range exceeds the size limit of the set type */
|
||||||
|
IPSET_ERR_BITMAP_RANGE_SIZE,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _UAPI__IP_SET_BITMAP_H */
|
21
include/uapi/linux/netfilter/ipset/ip_set_hash.h
Normal file
21
include/uapi/linux/netfilter/ipset/ip_set_hash.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef _UAPI__IP_SET_HASH_H
|
||||||
|
#define _UAPI__IP_SET_HASH_H
|
||||||
|
|
||||||
|
/* Hash type specific error codes */
|
||||||
|
enum {
|
||||||
|
/* Hash is full */
|
||||||
|
IPSET_ERR_HASH_FULL = IPSET_ERR_TYPE_SPECIFIC,
|
||||||
|
/* Null-valued element */
|
||||||
|
IPSET_ERR_HASH_ELEM,
|
||||||
|
/* Invalid protocol */
|
||||||
|
IPSET_ERR_INVALID_PROTO,
|
||||||
|
/* Protocol missing but must be specified */
|
||||||
|
IPSET_ERR_MISSING_PROTO,
|
||||||
|
/* Range not supported */
|
||||||
|
IPSET_ERR_HASH_RANGE_UNSUPPORTED,
|
||||||
|
/* Invalid range */
|
||||||
|
IPSET_ERR_HASH_RANGE,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _UAPI__IP_SET_HASH_H */
|
21
include/uapi/linux/netfilter/ipset/ip_set_list.h
Normal file
21
include/uapi/linux/netfilter/ipset/ip_set_list.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef _UAPI__IP_SET_LIST_H
|
||||||
|
#define _UAPI__IP_SET_LIST_H
|
||||||
|
|
||||||
|
/* List type specific error codes */
|
||||||
|
enum {
|
||||||
|
/* Set name to be added/deleted/tested does not exist. */
|
||||||
|
IPSET_ERR_NAME = IPSET_ERR_TYPE_SPECIFIC,
|
||||||
|
/* list:set type is not permitted to add */
|
||||||
|
IPSET_ERR_LOOP,
|
||||||
|
/* Missing reference set */
|
||||||
|
IPSET_ERR_BEFORE,
|
||||||
|
/* Reference set does not exist */
|
||||||
|
IPSET_ERR_NAMEREF,
|
||||||
|
/* Set is full */
|
||||||
|
IPSET_ERR_LIST_FULL,
|
||||||
|
/* Reference set is not added to the set */
|
||||||
|
IPSET_ERR_REF_EXIST,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _UAPI__IP_SET_LIST_H */
|
117
include/uapi/linux/netfilter/nf_conntrack_common.h
Normal file
117
include/uapi/linux/netfilter/nf_conntrack_common.h
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
#ifndef _UAPI_NF_CONNTRACK_COMMON_H
|
||||||
|
#define _UAPI_NF_CONNTRACK_COMMON_H
|
||||||
|
/* Connection state tracking for netfilter. This is separated from,
|
||||||
|
but required by, the NAT layer; it can also be used by an iptables
|
||||||
|
extension. */
|
||||||
|
enum ip_conntrack_info {
|
||||||
|
/* Part of an established connection (either direction). */
|
||||||
|
IP_CT_ESTABLISHED,
|
||||||
|
|
||||||
|
/* Like NEW, but related to an existing connection, or ICMP error
|
||||||
|
(in either direction). */
|
||||||
|
IP_CT_RELATED,
|
||||||
|
|
||||||
|
/* Started a new connection to track (only
|
||||||
|
IP_CT_DIR_ORIGINAL); may be a retransmission. */
|
||||||
|
IP_CT_NEW,
|
||||||
|
|
||||||
|
/* >= this indicates reply direction */
|
||||||
|
IP_CT_IS_REPLY,
|
||||||
|
|
||||||
|
IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY,
|
||||||
|
IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY,
|
||||||
|
IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY,
|
||||||
|
/* Number of distinct IP_CT types (no NEW in reply dirn). */
|
||||||
|
IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Bitset representing status of connection. */
|
||||||
|
enum ip_conntrack_status {
|
||||||
|
/* It's an expected connection: bit 0 set. This bit never changed */
|
||||||
|
IPS_EXPECTED_BIT = 0,
|
||||||
|
IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
|
||||||
|
|
||||||
|
/* We've seen packets both ways: bit 1 set. Can be set, not unset. */
|
||||||
|
IPS_SEEN_REPLY_BIT = 1,
|
||||||
|
IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
|
||||||
|
|
||||||
|
/* Conntrack should never be early-expired. */
|
||||||
|
IPS_ASSURED_BIT = 2,
|
||||||
|
IPS_ASSURED = (1 << IPS_ASSURED_BIT),
|
||||||
|
|
||||||
|
/* Connection is confirmed: originating packet has left box */
|
||||||
|
IPS_CONFIRMED_BIT = 3,
|
||||||
|
IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
|
||||||
|
|
||||||
|
/* Connection needs src nat in orig dir. This bit never changed. */
|
||||||
|
IPS_SRC_NAT_BIT = 4,
|
||||||
|
IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
|
||||||
|
|
||||||
|
/* Connection needs dst nat in orig dir. This bit never changed. */
|
||||||
|
IPS_DST_NAT_BIT = 5,
|
||||||
|
IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
|
||||||
|
|
||||||
|
/* Both together. */
|
||||||
|
IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
|
||||||
|
|
||||||
|
/* Connection needs TCP sequence adjusted. */
|
||||||
|
IPS_SEQ_ADJUST_BIT = 6,
|
||||||
|
IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
|
||||||
|
|
||||||
|
/* NAT initialization bits. */
|
||||||
|
IPS_SRC_NAT_DONE_BIT = 7,
|
||||||
|
IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
|
||||||
|
|
||||||
|
IPS_DST_NAT_DONE_BIT = 8,
|
||||||
|
IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
|
||||||
|
|
||||||
|
/* Both together */
|
||||||
|
IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
|
||||||
|
|
||||||
|
/* Connection is dying (removed from lists), can not be unset. */
|
||||||
|
IPS_DYING_BIT = 9,
|
||||||
|
IPS_DYING = (1 << IPS_DYING_BIT),
|
||||||
|
|
||||||
|
/* Connection has fixed timeout. */
|
||||||
|
IPS_FIXED_TIMEOUT_BIT = 10,
|
||||||
|
IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
|
||||||
|
|
||||||
|
/* Conntrack is a template */
|
||||||
|
IPS_TEMPLATE_BIT = 11,
|
||||||
|
IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT),
|
||||||
|
|
||||||
|
/* Conntrack is a fake untracked entry */
|
||||||
|
IPS_UNTRACKED_BIT = 12,
|
||||||
|
IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
|
||||||
|
|
||||||
|
/* Conntrack got a helper explicitly attached via CT target. */
|
||||||
|
IPS_HELPER_BIT = 13,
|
||||||
|
IPS_HELPER = (1 << IPS_HELPER_BIT),
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Connection tracking event types */
|
||||||
|
enum ip_conntrack_events {
|
||||||
|
IPCT_NEW, /* new conntrack */
|
||||||
|
IPCT_RELATED, /* related conntrack */
|
||||||
|
IPCT_DESTROY, /* destroyed conntrack */
|
||||||
|
IPCT_REPLY, /* connection has seen two-way traffic */
|
||||||
|
IPCT_ASSURED, /* connection status has changed to assured */
|
||||||
|
IPCT_PROTOINFO, /* protocol information has changed */
|
||||||
|
IPCT_HELPER, /* new helper has been set */
|
||||||
|
IPCT_MARK, /* new mark has been set */
|
||||||
|
IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
|
||||||
|
IPCT_SECMARK, /* new security mark has been set */
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ip_conntrack_expect_events {
|
||||||
|
IPEXP_NEW, /* new expectation */
|
||||||
|
IPEXP_DESTROY, /* destroyed expectation */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* expectation flags */
|
||||||
|
#define NF_CT_EXPECT_PERMANENT 0x1
|
||||||
|
#define NF_CT_EXPECT_INACTIVE 0x2
|
||||||
|
#define NF_CT_EXPECT_USERSPACE 0x4
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _UAPI_NF_CONNTRACK_COMMON_H */
|
18
include/uapi/linux/netfilter/nf_conntrack_ftp.h
Normal file
18
include/uapi/linux/netfilter/nf_conntrack_ftp.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef _UAPI_NF_CONNTRACK_FTP_H
|
||||||
|
#define _UAPI_NF_CONNTRACK_FTP_H
|
||||||
|
/* FTP tracking. */
|
||||||
|
|
||||||
|
/* This enum is exposed to userspace */
|
||||||
|
enum nf_ct_ftp_type {
|
||||||
|
/* PORT command from client */
|
||||||
|
NF_CT_FTP_PORT,
|
||||||
|
/* PASV response from server */
|
||||||
|
NF_CT_FTP_PASV,
|
||||||
|
/* EPRT command from client */
|
||||||
|
NF_CT_FTP_EPRT,
|
||||||
|
/* EPSV response from server */
|
||||||
|
NF_CT_FTP_EPSV,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _UAPI_NF_CONNTRACK_FTP_H */
|
51
include/uapi/linux/netfilter/nf_conntrack_tcp.h
Normal file
51
include/uapi/linux/netfilter/nf_conntrack_tcp.h
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
#ifndef _UAPI_NF_CONNTRACK_TCP_H
|
||||||
|
#define _UAPI_NF_CONNTRACK_TCP_H
|
||||||
|
/* TCP tracking. */
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
/* This is exposed to userspace (ctnetlink) */
|
||||||
|
enum tcp_conntrack {
|
||||||
|
TCP_CONNTRACK_NONE,
|
||||||
|
TCP_CONNTRACK_SYN_SENT,
|
||||||
|
TCP_CONNTRACK_SYN_RECV,
|
||||||
|
TCP_CONNTRACK_ESTABLISHED,
|
||||||
|
TCP_CONNTRACK_FIN_WAIT,
|
||||||
|
TCP_CONNTRACK_CLOSE_WAIT,
|
||||||
|
TCP_CONNTRACK_LAST_ACK,
|
||||||
|
TCP_CONNTRACK_TIME_WAIT,
|
||||||
|
TCP_CONNTRACK_CLOSE,
|
||||||
|
TCP_CONNTRACK_LISTEN, /* obsolete */
|
||||||
|
#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN
|
||||||
|
TCP_CONNTRACK_MAX,
|
||||||
|
TCP_CONNTRACK_IGNORE,
|
||||||
|
TCP_CONNTRACK_RETRANS,
|
||||||
|
TCP_CONNTRACK_UNACK,
|
||||||
|
TCP_CONNTRACK_TIMEOUT_MAX
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Window scaling is advertised by the sender */
|
||||||
|
#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
|
||||||
|
|
||||||
|
/* SACK is permitted by the sender */
|
||||||
|
#define IP_CT_TCP_FLAG_SACK_PERM 0x02
|
||||||
|
|
||||||
|
/* This sender sent FIN first */
|
||||||
|
#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
|
||||||
|
|
||||||
|
/* Be liberal in window checking */
|
||||||
|
#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
|
||||||
|
|
||||||
|
/* Has unacknowledged data */
|
||||||
|
#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10
|
||||||
|
|
||||||
|
/* The field td_maxack has been set */
|
||||||
|
#define IP_CT_TCP_FLAG_MAXACK_SET 0x20
|
||||||
|
|
||||||
|
struct nf_ct_tcp_flags {
|
||||||
|
__u8 flags;
|
||||||
|
__u8 mask;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _UAPI_NF_CONNTRACK_TCP_H */
|
56
include/uapi/linux/netfilter/nfnetlink.h
Normal file
56
include/uapi/linux/netfilter/nfnetlink.h
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
#ifndef _UAPI_NFNETLINK_H
|
||||||
|
#define _UAPI_NFNETLINK_H
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/netfilter/nfnetlink_compat.h>
|
||||||
|
|
||||||
|
enum nfnetlink_groups {
|
||||||
|
NFNLGRP_NONE,
|
||||||
|
#define NFNLGRP_NONE NFNLGRP_NONE
|
||||||
|
NFNLGRP_CONNTRACK_NEW,
|
||||||
|
#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
|
||||||
|
NFNLGRP_CONNTRACK_UPDATE,
|
||||||
|
#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
|
||||||
|
NFNLGRP_CONNTRACK_DESTROY,
|
||||||
|
#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
|
||||||
|
NFNLGRP_CONNTRACK_EXP_NEW,
|
||||||
|
#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
|
||||||
|
NFNLGRP_CONNTRACK_EXP_UPDATE,
|
||||||
|
#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
|
||||||
|
NFNLGRP_CONNTRACK_EXP_DESTROY,
|
||||||
|
#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
|
||||||
|
__NFNLGRP_MAX,
|
||||||
|
};
|
||||||
|
#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
|
||||||
|
|
||||||
|
/* General form of address family dependent message.
|
||||||
|
*/
|
||||||
|
struct nfgenmsg {
|
||||||
|
__u8 nfgen_family; /* AF_xxx */
|
||||||
|
__u8 version; /* nfnetlink version */
|
||||||
|
__be16 res_id; /* resource id */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define NFNETLINK_V0 0
|
||||||
|
|
||||||
|
/* netfilter netlink message types are split in two pieces:
|
||||||
|
* 8 bit subsystem, 8bit operation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
|
||||||
|
#define NFNL_MSG_TYPE(x) (x & 0x00ff)
|
||||||
|
|
||||||
|
/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
|
||||||
|
* won't work anymore */
|
||||||
|
#define NFNL_SUBSYS_NONE 0
|
||||||
|
#define NFNL_SUBSYS_CTNETLINK 1
|
||||||
|
#define NFNL_SUBSYS_CTNETLINK_EXP 2
|
||||||
|
#define NFNL_SUBSYS_QUEUE 3
|
||||||
|
#define NFNL_SUBSYS_ULOG 4
|
||||||
|
#define NFNL_SUBSYS_OSF 5
|
||||||
|
#define NFNL_SUBSYS_IPSET 6
|
||||||
|
#define NFNL_SUBSYS_ACCT 7
|
||||||
|
#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
|
||||||
|
#define NFNL_SUBSYS_CTHELPER 9
|
||||||
|
#define NFNL_SUBSYS_COUNT 10
|
||||||
|
|
||||||
|
#endif /* _UAPI_NFNETLINK_H */
|
27
include/uapi/linux/netfilter/nfnetlink_acct.h
Normal file
27
include/uapi/linux/netfilter/nfnetlink_acct.h
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef _UAPI_NFNL_ACCT_H_
|
||||||
|
#define _UAPI_NFNL_ACCT_H_
|
||||||
|
|
||||||
|
#ifndef NFACCT_NAME_MAX
|
||||||
|
#define NFACCT_NAME_MAX 32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
enum nfnl_acct_msg_types {
|
||||||
|
NFNL_MSG_ACCT_NEW,
|
||||||
|
NFNL_MSG_ACCT_GET,
|
||||||
|
NFNL_MSG_ACCT_GET_CTRZERO,
|
||||||
|
NFNL_MSG_ACCT_DEL,
|
||||||
|
NFNL_MSG_ACCT_MAX
|
||||||
|
};
|
||||||
|
|
||||||
|
enum nfnl_acct_type {
|
||||||
|
NFACCT_UNSPEC,
|
||||||
|
NFACCT_NAME,
|
||||||
|
NFACCT_PKTS,
|
||||||
|
NFACCT_BYTES,
|
||||||
|
NFACCT_USE,
|
||||||
|
__NFACCT_MAX
|
||||||
|
};
|
||||||
|
#define NFACCT_MAX (__NFACCT_MAX - 1)
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _UAPI_NFNL_ACCT_H_ */
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue