[lldp-devel] [PATCH 3/8] introduced changed config file interface

Jens Osterkamp jens at linux.vnet.ibm.com
Mon Aug 15 13:04:07 UTC 2011


On Wednesday 10 August 2011, John Fastabend wrote:
> On 8/5/2011 8:35 AM, Jens Osterkamp wrote:
> > This patch modifies all interface functions to get and set config file
> > values to use the agent type. The agent type will determine in which section
> > of the config file the values are located. The result is that now there are 3
> > sections in lldpad.conf for LLDP:
> > 
> >         - "lldp" or "nearest_bridge" (if newly created)
> >         - "nearest_customer_bridge"
> >         - "nearest_nontpmr_bridge"
> > 
> > So lldpad.conf will look similar like
> > 
> >         lldp {
> >                 ...
> >         }
> >         nearest_customer_bridge {
> >                 ...
> >         }
> >         nearest_nontmpr_bridge {
> >                 ...
> >         }
> > 
> > It also introduces a new lldptool parameter -g <agent>. Valid values for
> > <agent> are
> > 
> >         - "nearest_bridge" or "nb"
> >         - "nearest_customer_bridge" or "ncb"
> >         - "neareast_nontpmr_bridge" or "nntpmrb"
> > 
> > E.g. to enable the evbCfg TLV for the agent "nearest customer bridge" one
> > would use
> > 
> >         "lldptool -T -i eth8 -g ncb -V evbCfg -c enableTx=yes"
> > 
> > It modifies the lldp_mod_* functions to supply the agent where appropriate.
> > 
> > Signed-off-by: Jens Osterkamp <jens at linux.vnet.ibm.com>
> 
> If a -g option is not provided I expect nearest bridge is used by default?

Yes, nearest bridge is default to preserve the behaviour.

> 
> [...]
> 
> 
> > 
> > +/* evb_check_and_fill
> > + *
> > + * checks values received in TLV and takes over some values
> > + */
> > +int evb_check_and_fill(struct evb_data *ed, struct tlv_info_evb *tie)
> 
> 
> Why did this get moved?

IIRC this was to avoid a warning with the re-enabled -Wall flag.

> 
> > +{
> > +       /* sanity check of received data in tie */
> > +       if ((tie->smode & (LLDP_EVB_CAPABILITY_FORWARD_STANDARD |
> > +                         LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY)) == 0) {
> > +               LLDPAD_ERR("Neither standard nor rr set as forwarding mode !");
> > +               return TLV_ERR;
> > +       }
> > +
> > +       if ((tie->svsi < 0) || (tie->svsi > LLDP_EVB_DEFAULT_MAX_VSI)) {
> > +               LLDPAD_ERR("nr of supported vsis (%i) exceeds allow value range !", ntohs(tie->svsi));
> > +               return TLV_ERR;
> > +       }
> > +
> > +       if ((tie->cvsi < 0) || (tie->cvsi > LLDP_EVB_DEFAULT_MAX_VSI)) {
> > +               LLDPAD_ERR("nr of configured vsis (%i) exceeds allow value range !", ntohs(tie->cvsi));
> > +               return TLV_ERR;
> > +       }
> > +
> > +       /* check bridge capabilities against local policy*/
> > +       /* if bridge supports RR and we support it as well, request it
> > +        * by setting smode in tlv to be sent out (ed->tie->smode) */
> > +       if ((tie->smode & LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY) &&
> > +            (ed->policy->smode & LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY)) {
> > +               ed->tie->smode = LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY;
> > +       } else {
> > +               ed->tie->smode = LLDP_EVB_CAPABILITY_FORWARD_STANDARD;
> > +       }
> > +
> > +       /* maybe switch has already set the mode based on the saved info sent
> > +        * out on ifup */
> > +       if (tie->cmode == ed->tie->smode)
> > +               ed->tie->cmode = tie->cmode;
> > +
> > +       ed->tie->scap = ed->policy->scap;
> > +
> > +       /* If both sides support RTE, support and configure it */
> > +       if ((tie->scap & ed->policy->scap) & LLDP_EVB_CAPABILITY_PROTOCOL_RTE) {
> > +               ed->tie->ccap |= LLDP_EVB_CAPABILITY_PROTOCOL_RTE;
> > +       } else {
> > +               ed->tie->ccap &= ~LLDP_EVB_CAPABILITY_PROTOCOL_RTE;
> > +       }
> > +
> > +       /* If both sides support ECP, set it */
> > +       if ((tie->scap & ed->policy->scap) & LLDP_EVB_CAPABILITY_PROTOCOL_ECP) {
> > +               ed->tie->ccap |= LLDP_EVB_CAPABILITY_PROTOCOL_ECP;
> > +       } else {
> > +               ed->tie->ccap &= ~LLDP_EVB_CAPABILITY_PROTOCOL_ECP;
> > +       }
> > +
> > +       /* If both sides support VDP, set it */
> > +       if ((tie->scap & ed->policy->scap) & LLDP_EVB_CAPABILITY_PROTOCOL_VDP) {
> > +               ed->tie->ccap |= LLDP_EVB_CAPABILITY_PROTOCOL_VDP;
> > +       } else {
> > +               ed->tie->ccap &= ~LLDP_EVB_CAPABILITY_PROTOCOL_VDP;
> > +       }
> > +
> > +       /* If supported caps include VDP take over min value of both */
> > +       if (ed->tie->scap & LLDP_EVB_CAPABILITY_PROTOCOL_VDP) {
> > +               ed->tie->svsi = tie->svsi;
> > +               ed->tie->cvsi = htons(vdp_vsis(ed->ifname));
> > +       } else {
> > +               ed->tie->svsi = 0;
> > +               ed->tie->cvsi = 0;
> > +       }
> > +
> > +       /* If both sides support RTE and value offer is > 0, set it */
> > +       if ((ed->tie->scap & LLDP_EVB_CAPABILITY_PROTOCOL_RTE) &&
> > +               (tie->rte > 0) && (ed->policy->rte > 0))
> > +               ed->tie->rte = MAX(ed->policy->rte,tie->rte);
> > +
> > +       return TLV_OK;
> > +}
> > +
> >  /* evb_process_tlv - processes the tlv
> >   * @ed: evb_data for the interface
> >   * @tie: incoming tlv
> > @@ -134,7 +214,7 @@ static void evb_update_tlv(struct evb_data *ed)
> >   *
> >   * Returns 0 on success
> >   */
> > -static int evb_bld_cfg_tlv(struct evb_data *ed)
> > +static int evb_bld_cfg_tlv(struct evb_data *ed, struct lldp_agent *agent)
> >  {
> >         int rc = 0;
> >         struct unpacked_tlv *tlv = NULL;
> > @@ -142,7 +222,8 @@ static int evb_bld_cfg_tlv(struct evb_data *ed)
> >         /* free ed->evb if it exists */
> >         FREE_UNPKD_TLV(ed, evb);
> > 
> > -       if (!is_tlv_txenabled(ed->ifname, TLVID_8021Qbg(LLDP_EVB_SUBTYPE))) {
> > +       if (!is_tlv_txenabled(ed->ifname, agent->type,
> > +                             TLVID_8021Qbg(LLDP_EVB_SUBTYPE))) {
> >                 LLDPAD_DBG("%s:%s:EVB tx is currently disabled !\n",
> >                         __func__, ed->ifname);
> >                 rc = EINVAL;
> > @@ -188,7 +269,7 @@ static void evb_free_tlv(struct evb_data *ed)
> >   *
> >   * fill up tlv_info_evb structure with reasonable info
> >   */
> > -static int evb_init_cfg_tlv(struct evb_data *ed)
> > +static int evb_init_cfg_tlv(struct evb_data *ed, struct lldp_agent *agent)
> >  {
> >         char arg_path[EVB_BUF_SIZE];
> >         char *param;
> > @@ -213,15 +294,16 @@ static int evb_init_cfg_tlv(struct evb_data *ed)
> >         snprintf(arg_path, sizeof(arg_path), "%s%08x.fmode",
> >                  TLVID_PREFIX, TLVID_8021Qbg(LLDP_EVB_SUBTYPE));
> > 
> > -       if (get_cfg(ed->ifname, arg_path, (void *) &param, CONFIG_TYPE_STRING)) {
> > +       if (get_cfg(ed->ifname, agent->type, arg_path,
> > +                   (void *) &param, CONFIG_TYPE_STRING)) {
> >                 LLDPAD_INFO("%s:%s: loading EVB policy for forwarding mode failed, using default.\n",
> >                         __func__, ed->ifname);
> >         } else {
> > -               if (strcasestr(param, VAL_EVB_FMODE_BRIDGE)) {
> > +               if (strstr(param, VAL_EVB_FMODE_BRIDGE)) {
> >                         ed->policy->smode = LLDP_EVB_CAPABILITY_FORWARD_STANDARD;
> >                 }
> > 
> > -               if (strcasestr(param, VAL_EVB_FMODE_REFLECTIVE_RELAY)) {
> > +               if (strstr(param, VAL_EVB_FMODE_REFLECTIVE_RELAY)) {
> >                         ed->policy->smode = LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY;
> >                 }
> > 
> > @@ -233,23 +315,24 @@ static int evb_init_cfg_tlv(struct evb_data *ed)
> >         snprintf(arg_path, sizeof(arg_path), "%s%08x.capabilities",
> >                  TLVID_PREFIX, TLVID_8021Qbg(LLDP_EVB_SUBTYPE));
> > 
> > -       if (get_cfg(ed->ifname, arg_path, (void *) &param, CONFIG_TYPE_STRING)) {
> > +       if (get_cfg(ed->ifname, agent->type, arg_path,
> > +                   (void *) &param, CONFIG_TYPE_STRING)) {
> >                 LLDPAD_INFO("%s:%s: loading EVB policy for capabilities failed, using default.\n",
> >                         __func__, ed->ifname);
> >         } else {
> > -               if (strcasestr(param, VAL_EVB_CAPA_RTE)) {
> > +               if (strstr(param, VAL_EVB_CAPA_RTE)) {
> >                         ed->policy->scap |= LLDP_EVB_CAPABILITY_PROTOCOL_RTE;
> >                 }
> > 
> > -               if (strcasestr(param, VAL_EVB_CAPA_ECP)) {
> > +               if (strstr(param, VAL_EVB_CAPA_ECP)) {
> >                         ed->policy->scap |= LLDP_EVB_CAPABILITY_PROTOCOL_ECP;
> >                 }
> > 
> > -               if (strcasestr(param, VAL_EVB_CAPA_VDP)) {
> > +               if (strstr(param, VAL_EVB_CAPA_VDP)) {
> >                         ed->policy->scap |= LLDP_EVB_CAPABILITY_PROTOCOL_VDP;
> >                 }
> > 
> > -               if (strcasestr(param, VAL_EVB_CAPA_NONE)) {
> > +               if (strstr(param, VAL_EVB_CAPA_NONE)) {
> >                         ed->policy->scap = 0;
> >                 }
> > 
> > @@ -261,7 +344,8 @@ static int evb_init_cfg_tlv(struct evb_data *ed)
> >         snprintf(arg_path, sizeof(arg_path), "%s%08x.rte",
> >                  TLVID_PREFIX, TLVID_8021Qbg(LLDP_EVB_SUBTYPE));
> > 
> > -       if (get_cfg(ed->ifname, arg_path, (void *) &param, CONFIG_TYPE_STRING)) {
> > +       if (get_cfg(ed->ifname, NEAREST_CUSTOMER_BRIDGE, arg_path,
> > +                   (void *) &param, CONFIG_TYPE_STRING)) {
> >                 LLDPAD_INFO("%s:%s: loading EVB policy for rte failed, using default.\n",
> >                         __func__, ed->ifname);
> >         } else {
> > @@ -275,7 +359,8 @@ static int evb_init_cfg_tlv(struct evb_data *ed)
> >         snprintf(arg_path, sizeof(arg_path), "%s%08x.vsis",
> >                  TLVID_PREFIX, TLVID_8021Qbg(LLDP_EVB_SUBTYPE));
> > 
> > -       if (get_cfg(ed->ifname, arg_path, (void *) &param, CONFIG_TYPE_STRING)) {
> > +       if (get_cfg(ed->ifname, agent->type, arg_path,
> > +                   (void *) &param, CONFIG_TYPE_STRING)) {
> >                 LLDPAD_INFO("%s:%s: loading EVB policy for vsis failed, using default.\n",
> >                         __func__, ed->ifname);
> >         } else {
> > @@ -285,7 +370,6 @@ static int evb_init_cfg_tlv(struct evb_data *ed)
> >                 LLDPAD_DBG("%s:%s: policy param vsis = %i.\n", __func__, ed->ifname, ntohs(ed->policy->svsi));
> >         }
> > 
> > -       /* load last used EVB TLV ... */
> >         ed->tie = (struct tlv_info_evb *) calloc(1, sizeof(struct tlv_info_evb));
> > 
> >         if (!ed->tie) {
> > @@ -294,22 +378,17 @@ static int evb_init_cfg_tlv(struct evb_data *ed)
> >                 return ENOMEM;
> >         }
> > 
> > -       if (get_config_tlvinfo_bin(ed->ifname, TLVID_8021Qbg(LLDP_EVB_SUBTYPE),
> > -                              (void *)ed->tie, sizeof(struct tlv_info_evb))) {
> > -               LLDPAD_INFO("%s:%s: loading last used EVB TLV failed, using default.\n",
> > -                       __func__, ed->ifname);
> > -               hton24(ed->tie->oui, LLDP_MOD_EVB);
> > -               ed->tie->smode = ed->policy->smode;
> > -               ed->tie->cmode = 0x0;
> > -               ed->tie->scap  = ed->policy->scap;
> > -               ed->tie->ccap = 0x0;
> > -               ed->tie->svsi = htons(LLDP_EVB_DEFAULT_SVSI);
> > -               ed->tie->cvsi = htons(0x0);
> > -               ed->tie->rte = LLDP_EVB_DEFAULT_RTE;
> > -       } else {
> > -               LLDPAD_INFO("%s(%i): loaded last used EVB TLV from file.\n", __FILE__, __LINE__);
> > -       }
> > +       hton24(ed->tie->oui, LLDP_MOD_EVB);
> > +       ed->tie->smode = ed->policy->smode;
> > +       ed->tie->cmode = 0x0;
> > +       ed->tie->scap  = ed->policy->scap;
> > +       ed->tie->ccap = 0x0;
> > +       ed->tie->svsi = htons(LLDP_EVB_DEFAULT_SVSI);
> > +       ed->tie->cvsi = htons(0x0);
> > +       ed->tie->rte = LLDP_EVB_DEFAULT_RTE;
> > 
> > +       LLDPAD_INFO("%s:%s: filling last used EVB TLV, using default.\n",
> > +               __func__, ed->ifname);
> >         ed->last = (struct tlv_info_evb *) calloc(1, sizeof(struct tlv_info_evb));
> > 
> >         if (!ed->last) {
> > @@ -320,12 +399,13 @@ static int evb_init_cfg_tlv(struct evb_data *ed)
> >                 return ENOMEM;
> >         }
> > 
> > -       ed->last->smode = LLDP_EVB_CAPABILITY_FORWARD_STANDARD;
> > +       ed->last->smode = LLDP_EVB_CAPABILITY_FORWARD_STANDARD | \
> > +                         LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY;
> > 
> >         return 0;
> >  }
> > 
> > -static int evb_bld_tlv(struct evb_data *ed)
> > +static int evb_bld_tlv(struct evb_data *ed, struct lldp_agent *agent)
> >  {
> >         int rc = 0;
> > 
> > @@ -334,7 +414,7 @@ static int evb_bld_tlv(struct evb_data *ed)
> >                 goto out_err;
> >         }
> > 
> > -       if (evb_bld_cfg_tlv(ed)) {
> > +       if (evb_bld_cfg_tlv(ed, agent)) {
> >                 LLDPAD_DBG("%s:%s:evb_bld_cfg_tlv() failed\n",
> >                                 __func__, ed->ifname);
> >                 rc = EINVAL;
> > @@ -369,7 +449,7 @@ struct packed_tlv *evb_gettlv(struct port *port, struct lldp_agent *agent)
> > 
> >         evb_free_tlv(ed);
> > 
> > -       if (evb_bld_tlv(ed)) {
> > +       if (evb_bld_tlv(ed, agent)) {
> >                 LLDPAD_DBG("%s:%s evb_bld_tlv failed\n",
> >                         __func__, port->ifname);
> >                 goto disabled;
> > @@ -400,92 +480,6 @@ out_err:
> >         return NULL;
> >  }
> > 
> > -/* evb_check_and_fill
> > - *
> > - * checks values received in TLV and takes over some values
> > - */
> > -int evb_check_and_fill(struct evb_data *ed, struct tlv_info_evb *tie)
> > -{
> > -       /* sanity check of received data in tie */
> > -       if ((tie->smode & (LLDP_EVB_CAPABILITY_FORWARD_STANDARD |
> > -                         LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY)) == 0) {
> > -               LLDPAD_ERR("Neither standard nor rr set as forwarding mode !");
> > -               return TLV_ERR;
> > -       }
> > -
> > -       if ((tie->svsi < 0) || (tie->svsi > LLDP_EVB_DEFAULT_MAX_VSI)) {
> > -               LLDPAD_ERR("nr of supported vsis (%i) exceeds allow value range !", ntohs(tie->svsi));
> > -               return TLV_ERR;
> > -       }
> > -
> > -       if ((tie->cvsi < 0) || (tie->cvsi > LLDP_EVB_DEFAULT_MAX_VSI)) {
> > -               LLDPAD_ERR("nr of configured vsis (%i) exceeds allow value range !", ntohs(tie->cvsi));
> > -               return TLV_ERR;
> > -       }
> > -
> > -       /* check bridge capabilities against local policy*/
> > -       /* if bridge supports RR and we support it as well, request it
> > -        * by setting smode in tlv to be sent out (ed->tie->smode) */
> > -       if ((tie->smode & LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY) &&
> > -            (ed->policy->smode & LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY)) {
> > -               ed->tie->smode = LLDP_EVB_CAPABILITY_FORWARD_REFLECTIVE_RELAY;
> > -       } else {
> > -               ed->tie->smode = LLDP_EVB_CAPABILITY_FORWARD_STANDARD;
> > -       }
> > -
> > -       /* maybe switch has already set the mode based on the saved info sent
> > -        * out on ifup */
> > -
> > -       if (tie->cmode == ed->tie->smode)
> > -               ed->tie->cmode = tie->cmode;
> > -
> > -       ed->tie->scap = ed->policy->scap;
> > -
> > -       /* If both sides support RTE, support and configure it */
> > -       if ((tie->scap & ed->policy->scap) & LLDP_EVB_CAPABILITY_PROTOCOL_RTE) {
> > -               ed->tie->ccap |= LLDP_EVB_CAPABILITY_PROTOCOL_RTE;
> > -       } else {
> > -               ed->tie->ccap &= ~LLDP_EVB_CAPABILITY_PROTOCOL_RTE;
> > -       }
> > -
> > -       /* If both sides support ECP, set it */
> > -       if ((tie->scap & ed->policy->scap) & LLDP_EVB_CAPABILITY_PROTOCOL_ECP) {
> > -               ed->tie->ccap |= LLDP_EVB_CAPABILITY_PROTOCOL_ECP;
> > -       } else {
> > -               ed->tie->ccap &= ~LLDP_EVB_CAPABILITY_PROTOCOL_ECP;
> > -       }
> > -
> > -       /* If both sides support VDP, set it */
> > -       if ((tie->scap & ed->policy->scap) & LLDP_EVB_CAPABILITY_PROTOCOL_VDP) {
> > -               ed->tie->ccap |= LLDP_EVB_CAPABILITY_PROTOCOL_VDP;
> > -       } else {
> > -               ed->tie->ccap &= ~LLDP_EVB_CAPABILITY_PROTOCOL_VDP;
> > -       }
> > -
> > -       /* If supported caps include VDP take over min value of both */
> > -       if (ed->tie->scap & LLDP_EVB_CAPABILITY_PROTOCOL_VDP) {
> > -               ed->tie->svsi = tie->svsi;
> > -               ed->tie->cvsi = htons(vdp_vsis(ed->ifname));
> > -       } else {
> > -               ed->tie->svsi = 0;
> > -               ed->tie->cvsi = 0;
> > -       }
> > -
> > -       /* If both sides support RTE and value offer is > 0, set it */
> > -       if ((ed->tie->scap & LLDP_EVB_CAPABILITY_PROTOCOL_RTE) &&
> > -               (tie->rte > 0) && (ed->policy->rte > 0))
> > -               ed->tie->rte = MAX(ed->policy->rte,tie->rte);
> > -
> > -       if (set_config_tlvinfo_bin(ed->ifname, TLVID_8021Qbg(LLDP_EVB_SUBTYPE),
> > -                              (void *)ed->tie, sizeof(struct tlv_info_evb))) {
> > -               LLDPAD_ERR("%s(%i): error saving tlv_info_evb !\n", __FILE__, __LINE__);
> > -       } else {
> > -               LLDPAD_INFO("%s(%i): saved tlv_info_evb to config !\n", __FILE__, __LINE__);
> > -       }
> > -
> > -       return TLV_OK;
> > -}
> > -
> >  /*
> >   * evb_rchange: process RX TLV LLDPDU
> >   *
> 
> 
> [...]
> 
> snip a large section here of propagating changes.
> 
> 
> > diff --git a/lldptool.c b/lldptool.c
> > index db77a6e..fccda6a 100644
> > --- a/lldptool.c
> > +++ b/lldptool.c
> > @@ -139,7 +139,11 @@ static const char *commands_options =
> >  "                                       implemented for DCBX App TLV settings)\n"
> >  "  -n                                   \"neighbor\" option for command\n"
> >  "  -r                                   show raw message\n"
> > -"  -R                                   show only raw messages\n";
> > +"  -R                                   show only raw messages\n"
> > +"  -g                                  destination agent (may be one of):\n"
> > +"                                              - nearestbridge (nb) (default)\n"
> > +"                                              - nearestcustomerbridge (ncb)\n"
> > +"                                              - nearestnontpmrbridge (nntpmrb)\n";
> > 
> >  static const char *commands_help =
> >  "Commands:\n"
> > @@ -214,7 +218,7 @@ int hex2int(char *b)
> >         int i;
> >         int n=0;
> >         int m;
> > -
> > +
> >         for (i=0,m=1; i<2; i++,m--) {
> >                 if (isxdigit(*(b+i))) {
> >                         if (*(b+i) <= '9')
> > @@ -443,12 +447,13 @@ static int request(struct clif *clif, int argc, char *argv[])
> > 
> >         memset((void *)&command, 0, sizeof(command));
> >         command.cmd = cmd_nop;
> > +       command.type = NEAREST_BRIDGE;
> >         command.module_id = LLDP_MOD_MAND;
> >         command.tlvid = INVALID_TLVID;
> > 
> 
> OK good NEAREST_BRIDGE is the default. Please add a line to the commit description
> just to make it painfully obvious. Or I'll do it when I commit this.

Done.

> 
> >         opterr = 0;
> >         for (;;) {
> > -               c = getopt(argc, argv, "Si:tTlLhcdnvrRqV:");
> > +               c = getopt(argc, argv, "Si:tTlLhcdnvrRqV:g:");
> >                 if (c < 0)
> >                         break;
> >                 switch (c) {
> > @@ -463,6 +468,21 @@ static int request(struct clif *clif, int argc, char *argv[])
> >                         strncpy(command.ifname, optarg, IFNAMSIZ);
> >                         command.ifname[IFNAMSIZ] ='\0';
> >                         break;
> > +               case 'g':
> > +                       if (!strcasecmp(optarg, "nearestbridge") ||
> > +                           !strcasecmp(optarg, "nb"))
> > +                               command.type = NEAREST_BRIDGE;
> > +                       else if (!strcasecmp(optarg, "nearestcustomerbridge") ||
> > +                                !strcasecmp(optarg, "ncb"))
> > +                               command.type = NEAREST_CUSTOMER_BRIDGE;
> > +                       else if (!strcasecmp(optarg, "nearestnontmprbridge") ||
> > +                                !strcasecmp(optarg, "nntpmrb"))
> > +                               command.type = NEAREST_NONTPMR_BRIDGE;
> > +                       else {
> > +                               printf("Invalid agent specified !\n\n");
> > +                               return -1;
> > +                       }
> > +                       break;
> >                 case 'V':
> >                         if (command.tlvid != INVALID_TLVID) {
> >                                 printf("\nInvalid command: multiple TLV "
> > diff --git a/lldptool_cmds.c b/lldptool_cmds.c
> > index d0985f6..26d4e33 100644
> > --- a/lldptool_cmds.c
> > +++ b/lldptool_cmds.c
> > @@ -48,10 +48,10 @@ static int render_cmd(struct cmd *cmd, int argc, char **args, char **argvals)
> >         len = sizeof(cmd->obuf);
> > 
> >         /* all command messages begin this way */
> > -       snprintf(cmd->obuf, len, "%c%08x%c%1x%02x%08x%02x%s",
> > +       snprintf(cmd->obuf, len, "%c%08x%c%1x%02x%08x%02x%s%02x",
> >                 MOD_CMD, cmd->module_id, CMD_REQUEST, CLIF_MSG_VERSION,
> >                 cmd->cmd, cmd->ops, (unsigned int) strlen(cmd->ifname),
> > -               cmd->ifname);
> > +               cmd->ifname, cmd->type);
> > 
> >         /* if the command is a tlv command, add the tlvid to the message */
> >         if (cmd->cmd == cmd_gettlv || cmd->cmd == cmd_settlv)
> 
> 
> Jens, this looks good. Please follow up with a lldptool man page update.

Will be included in my resend of the series.

Jens

-- 

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294



More information about the lldp-devel mailing list