Lines Matching refs:blk
164 FeedAppConfLine(struct conf_block *blk, char *line, int len) in FeedAppConfLine() argument
166 struct app_conf * const conf = (struct app_conf *)blk->conf; in FeedAppConfLine()
188 FeedMosConfLine(struct conf_block *blk, char *line, int len) in FeedMosConfLine() argument
190 struct mos_conf * const conf = (struct mos_conf *)blk->conf; in FeedMosConfLine()
220 FeedNetdevConfLine(struct conf_block *blk, char *line, int len) in FeedNetdevConfLine() argument
222 struct netdev_conf * const conf = (struct netdev_conf *)blk->conf; in FeedNetdevConfLine()
291 FeedArpConfLine(struct conf_block *blk, char *line, int len) in FeedArpConfLine() argument
293 struct arp_conf * const conf = (struct arp_conf *)blk->conf; in FeedArpConfLine()
325 FeedRouteConfLine(struct conf_block *blk, char *line, int len) in FeedRouteConfLine() argument
327 struct route_conf * const conf = (struct route_conf *)blk->conf; in FeedRouteConfLine()
358 FeedNICFwdConfLine(struct conf_block *blk, char *line, int len) in FeedNICFwdConfLine() argument
360 struct nic_forward_conf * const conf = (struct nic_forward_conf *)blk->conf; in FeedNICFwdConfLine()
385 MosConfAddChild(struct conf_block *blk, struct conf_block *child) in MosConfAddChild() argument
387 struct mos_conf * const conf = (struct mos_conf *)blk->conf; in MosConfAddChild()
406 AppConfIsValid(struct conf_block *blk) in AppConfIsValid() argument
408 struct app_conf * const conf = (struct app_conf *)blk->conf; in AppConfIsValid()
417 MosConfIsValid(struct conf_block *blk) in MosConfIsValid() argument
423 NetdevConfIsValid(struct conf_block *blk) in NetdevConfIsValid() argument
429 ArpConfIsValid(struct conf_block *blk) in ArpConfIsValid() argument
435 RouteConfIsValid(struct conf_block *blk) in RouteConfIsValid() argument
441 NICFwdConfIsValid(struct conf_block *blk) in NICFwdConfIsValid() argument
447 NetdevConfPrint(struct conf_block *blk) in NetdevConfPrint() argument
449 struct netdev_conf * const conf = (struct netdev_conf *)blk->conf; in NetdevConfPrint()
466 ArpConfPrint(struct conf_block *blk) in ArpConfPrint() argument
468 struct arp_conf * const conf = (struct arp_conf *)blk->conf; in ArpConfPrint()
485 RouteConfPrint(struct conf_block *blk) in RouteConfPrint() argument
487 struct route_conf * const conf = (struct route_conf *)blk->conf; in RouteConfPrint()
501 NICFwdConfPrint(struct conf_block *blk) in NICFwdConfPrint() argument
504 struct nic_forward_conf * const conf = (struct nic_forward_conf *)blk->conf; in NICFwdConfPrint()
523 AppConfPrint(struct conf_block *blk) in AppConfPrint() argument
525 struct app_conf * const conf = (struct app_conf *)blk->conf; in AppConfPrint()
536 MosConfPrint(struct conf_block *blk) in MosConfPrint() argument
538 struct mos_conf * const conf = (struct mos_conf *)blk->conf; in MosConfPrint()
565 InitAppBlock(struct config *config, struct conf_block *blk) in InitAppBlock() argument
567 assert(blk); in InitAppBlock()
569 blk->name = APP_BLOCK_NAME; in InitAppBlock()
571 blk->feed = FeedAppConfLine; in InitAppBlock()
572 blk->addchild = NULL; in InitAppBlock()
573 blk->isvalid = AppConfIsValid; in InitAppBlock()
574 blk->print = AppConfPrint; in InitAppBlock()
585 blk->conf = conf; in InitAppBlock()
587 blk->list = (typeof(blk->list))&config->app_blkh; in InitAppBlock()
591 InitMosBlock(struct config *config, struct conf_block *blk) in InitMosBlock() argument
593 assert(blk); in InitMosBlock()
595 blk->name = MOS_BLOCK_NAME; in InitMosBlock()
597 blk->feed = FeedMosConfLine; in InitMosBlock()
598 blk->addchild = MosConfAddChild; in InitMosBlock()
599 blk->isvalid = MosConfIsValid; in InitMosBlock()
600 blk->print = MosConfPrint; in InitMosBlock()
617 blk->conf = conf; in InitMosBlock()
619 blk->list = (typeof(blk->list))&config->mos_blkh; in InitMosBlock()
624 InitNetdevBlock(struct config *config, struct conf_block *blk) in InitNetdevBlock() argument
626 assert(blk); in InitNetdevBlock()
628 blk->name = NETDEV_BLOCK_NAME; in InitNetdevBlock()
630 blk->feed = FeedNetdevConfLine; in InitNetdevBlock()
631 blk->addchild = NULL; in InitNetdevBlock()
632 blk->isvalid = NetdevConfIsValid; in InitNetdevBlock()
633 blk->print = NetdevConfPrint; in InitNetdevBlock()
641 blk->conf = conf; in InitNetdevBlock()
643 blk->list = NULL; in InitNetdevBlock()
783 InitArpBlock(struct config *config, struct conf_block *blk) in InitArpBlock() argument
785 assert(blk); in InitArpBlock()
787 blk->name = ARP_BLOCK_NAME; in InitArpBlock()
789 blk->feed = FeedArpConfLine; in InitArpBlock()
790 blk->addchild = NULL; in InitArpBlock()
791 blk->isvalid = ArpConfIsValid; in InitArpBlock()
792 blk->print = ArpConfPrint; in InitArpBlock()
800 blk->conf = conf; in InitArpBlock()
802 blk->list = NULL; in InitArpBlock()
803 config->mos->arp = blk; in InitArpBlock()
810 InitRouteBlock(struct config *config, struct conf_block *blk) in InitRouteBlock() argument
812 assert(blk); in InitRouteBlock()
814 blk->name = ROUTE_BLOCK_NAME; in InitRouteBlock()
816 blk->feed = FeedRouteConfLine; in InitRouteBlock()
817 blk->addchild = NULL; in InitRouteBlock()
818 blk->isvalid = RouteConfIsValid; in InitRouteBlock()
819 blk->print = RouteConfPrint; in InitRouteBlock()
827 blk->conf = conf; in InitRouteBlock()
829 blk->list = NULL; in InitRouteBlock()
830 config->mos->route = blk; in InitRouteBlock()
837 InitNICForwardBlock(struct config *config, struct conf_block *blk) in InitNICForwardBlock() argument
840 assert(blk); in InitNICForwardBlock()
841 blk->name = FORWARD_BLOCK_NAME; in InitNICForwardBlock()
843 blk->feed = FeedNICFwdConfLine; in InitNICForwardBlock()
844 blk->addchild = NULL; in InitNICForwardBlock()
845 blk->isvalid = NICFwdConfIsValid; in InitNICForwardBlock()
846 blk->print = NICFwdConfPrint; in InitNICForwardBlock()
857 blk->conf = conf; in InitNICForwardBlock()
859 blk->list = NULL; in InitNICForwardBlock()
860 config->mos->nic_forward = blk; in InitNICForwardBlock()
974 struct conf_block *blk; in InitConfig() local
982 blk = calloc(1, sizeof(struct conf_block)); in InitConfig()
983 if (blk == NULL) goto init_config_err; in InitConfig()
984 InitAppBlock(config, blk); in InitConfig()
985 TAILQ_INSERT_TAIL(&g_free_blkh, blk, link); in InitConfig()
988 blk = calloc(1, sizeof(struct conf_block)); in InitConfig()
989 if (blk == NULL) goto init_config_err; in InitConfig()
990 InitNetdevBlock(config, blk); in InitConfig()
991 TAILQ_INSERT_TAIL(&g_free_blkh, blk, link); in InitConfig()
996 blk = calloc(1, sizeof(struct conf_block)); in InitConfig()
997 if (blk == NULL) goto init_config_err; in InitConfig()
998 InitMosBlock(config, blk); in InitConfig()
999 TAILQ_INSERT_TAIL(&g_free_blkh, blk, link); in InitConfig()
1002 blk = calloc(1, sizeof(struct conf_block)); in InitConfig()
1003 if (blk == NULL) goto init_config_err; in InitConfig()
1004 InitArpBlock(config, blk); in InitConfig()
1005 TAILQ_INSERT_TAIL(&g_free_blkh, blk, link); in InitConfig()
1008 blk = calloc(1, sizeof(struct conf_block)); in InitConfig()
1009 if (blk == NULL) goto init_config_err; in InitConfig()
1010 InitRouteBlock(config, blk); in InitConfig()
1011 TAILQ_INSERT_TAIL(&g_free_blkh, blk, link); in InitConfig()
1014 blk = calloc (1, sizeof(struct conf_block)); in InitConfig()
1015 if (blk == NULL) goto init_config_err; in InitConfig()
1016 InitNICForwardBlock(config, blk); in InitConfig()
1017 TAILQ_INSERT_TAIL(&g_free_blkh, blk, link); in InitConfig()
1044 DetectBlock(struct conf_block *blk, char *buf, int len) in DetectBlock() argument
1092 if (blk) { in DetectBlock()
1093 assert(blk->addchild); in DetectBlock()
1094 blk->addchild(blk, nblk); in DetectBlock()
1104 ParseBlock(struct conf_block *blk) in ParseBlock() argument
1109 LINE_FOREACH(line, llen, blk->buf, blk->len) { in ParseBlock()
1112 if ((nblk = DetectBlock(blk, line, blk->len - (line - blk->buf)))) { in ParseBlock()
1118 blk->feed(blk, line, llen); in ParseBlock()