The Linux Networking Architecture [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

The Linux Networking Architecture [Electronic resources] - نسخه متنی

Klaus Wehrle

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








18.5 Ingress Policing


The file net/sched/sch_ingress.c implements a queuing discipline designed for ingress policing. Its structure is similar to that of other queuing disciplines, and the exported functions are similar to the functions described in the previous section.

However, rather than buffering packets, this queuing discipline classifies packets to decide whether a packet will be accepted or discarded. This means that the queuing discipline actually assumes a firewall or Netfilter functionality. This functionality also reflects in the return values of the enqueue() function, which are converted to Netfilter return values, as shown in the following excerpt from the function ingress_enqueue() (net/sched/sch_ingress.c):


case TC_POLICE_SHOT:
result = NF_DROP;
break;
case TC_POLICE_RECLASSIFY: /* DSCP remarking here ? */
case TC_POLICE_OK:
case TC_POLICE_UNSPEC:
default:
result = NF_ACCEPT;
break;

First, the function register_qdisc() registers the functions of the queuing discipline with the network device. Subsequently, the function nf_register_hook() hooks them into the hook NF_IP_PRE_ROUTING.

Next, additional filters can be appended to this particular queuing discipline. These filters can access functions from net/sched/police.c to check on whether a data stream complies with a token bucket.


/ 187