Changeset 13b50b3 in rtems-libbsd


Ignore:
Timestamp:
Oct 18, 2013, 2:13:41 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, c1e05b9ea378b2971e3d7704779112b4bc4296da, freebsd-9.3, 4a77611a223ea883fb548679b516d326a020d447
Children:
8ff186f
Parents:
c14bb23
git-author:
Sebastian Huber <sebastian.huber@…> (10/18/13 14:13:41)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/31/13 12:18:49)
Message:

IFCONFIG(8): Add const qualifier

Location:
freebsd/sbin/ifconfig
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sbin/ifconfig/ifbridge.c

    rc14bb23 r13b50b3  
    7272} while (0)
    7373
    74 static const char *stpstates[] = {
     74static const char *const stpstates[] = {
    7575        "disabled",
    7676        "listening",
     
    8080        "discarding"
    8181};
    82 static const char *stpproto[] = {
     82static const char *const stpproto[] = {
    8383        "stp",
    8484        "-",
    8585        "rstp"
    8686};
    87 static const char *stproles[] = {
     87static const char *const stproles[] = {
    8888        "disabled",
    8989        "root",
  • freebsd/sbin/ifconfig/ifcarp.c

    rc14bb23 r13b50b3  
    5151#include "ifconfig.h"
    5252
    53 static const char *carp_states[] = { CARP_STATES };
     53static const char *const carp_states[] = { CARP_STATES };
    5454
    5555void carp_status(int s);
  • freebsd/sbin/ifconfig/ifgif.c

    rc14bb23 r13b50b3  
    5454static void     gif_status(int);
    5555
    56 static struct {
     56static const struct {
    5757        const char      *label;
    5858        u_int           mask;
  • freebsd/sbin/ifconfig/ifieee80211.c

    rc14bb23 r13b50b3  
    24762476{
    24772477#define MS(_v, _f)      (((_v) & _f) >> _f##_S)
    2478         static const char *acnames[] = { "BE", "BK", "VO", "VI" };
     2478        static const char *const acnames[] = { "BE", "BK", "VO", "VI" };
    24792479        const struct ieee80211_wme_param *wme =
    24802480            (const struct ieee80211_wme_param *) ie;
     
    28452845        printf("%s", tag);
    28462846        if (verbose) {
    2847                 static const char *dev_pass_id[] = {
     2847                static const char *const dev_pass_id[] = {
    28482848                        "D",    /* Default (PIN) */
    28492849                        "U",    /* User-specified */
     
    33983398{
    33993399#define N(a)    (sizeof(a) / sizeof(a[0]))
    3400         static const char *state_names[] = {
     3400        static const char *const state_names[] = {
    34013401            [0] = "IDLE",
    34023402            [1] = "OPEN-TX",
     
    37273727list_wme(int s)
    37283728{
    3729         static const char *acnames[] = { "AC_BE", "AC_BK", "AC_VI", "AC_VO" };
     3729        static const char *const acnames[] = { "AC_BE", "AC_BK", "AC_VI", "AC_VO" };
    37303730        int ac;
    37313731
  • freebsd/sbin/ifconfig/ifmedia.c

    rc14bb23 r13b50b3  
    9494static int      get_media_mode(int, const char *);
    9595static int      get_media_options(int, const char *);
    96 static int      lookup_media_word(struct ifmedia_description *, const char *);
     96static int      lookup_media_word(const struct ifmedia_description *, const char *);
    9797static void     print_media_word(int, int);
    9898static void     print_media_word_ifconfig(int);
    9999
    100 static struct ifmedia_description *get_toptype_desc(int);
    101 static struct ifmedia_type_to_subtype *get_toptype_ttos(int);
    102 static struct ifmedia_description *get_subtype_desc(int,
    103     struct ifmedia_type_to_subtype *ttos);
     100static const struct ifmedia_description *get_toptype_desc(int);
     101static const struct ifmedia_type_to_subtype *get_toptype_ttos(int);
     102static const struct ifmedia_description *get_subtype_desc(int,
     103    const struct ifmedia_type_to_subtype *ttos);
    104104
    105105#define IFM_OPMODE(x) \
     
    363363 **********************************************************************/
    364364
    365 static struct ifmedia_description ifm_type_descriptions[] =
     365static const struct ifmedia_description ifm_type_descriptions[] =
    366366    IFM_TYPE_DESCRIPTIONS;
    367367
    368 static struct ifmedia_description ifm_subtype_ethernet_descriptions[] =
     368static const struct ifmedia_description ifm_subtype_ethernet_descriptions[] =
    369369    IFM_SUBTYPE_ETHERNET_DESCRIPTIONS;
    370370
    371 static struct ifmedia_description ifm_subtype_ethernet_aliases[] =
     371static const struct ifmedia_description ifm_subtype_ethernet_aliases[] =
    372372    IFM_SUBTYPE_ETHERNET_ALIASES;
    373373
    374 static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] =
     374static const struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] =
    375375    IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS;
    376376
    377 static struct ifmedia_description ifm_subtype_tokenring_descriptions[] =
     377static const struct ifmedia_description ifm_subtype_tokenring_descriptions[] =
    378378    IFM_SUBTYPE_TOKENRING_DESCRIPTIONS;
    379379
    380 static struct ifmedia_description ifm_subtype_tokenring_aliases[] =
     380static const struct ifmedia_description ifm_subtype_tokenring_aliases[] =
    381381    IFM_SUBTYPE_TOKENRING_ALIASES;
    382382
    383 static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] =
     383static const struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] =
    384384    IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS;
    385385
    386 static struct ifmedia_description ifm_subtype_fddi_descriptions[] =
     386static const struct ifmedia_description ifm_subtype_fddi_descriptions[] =
    387387    IFM_SUBTYPE_FDDI_DESCRIPTIONS;
    388388
    389 static struct ifmedia_description ifm_subtype_fddi_aliases[] =
     389static const struct ifmedia_description ifm_subtype_fddi_aliases[] =
    390390    IFM_SUBTYPE_FDDI_ALIASES;
    391391
    392 static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] =
     392static const struct ifmedia_description ifm_subtype_fddi_option_descriptions[] =
    393393    IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS;
    394394
    395 static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] =
     395static const struct ifmedia_description ifm_subtype_ieee80211_descriptions[] =
    396396    IFM_SUBTYPE_IEEE80211_DESCRIPTIONS;
    397397
    398 static struct ifmedia_description ifm_subtype_ieee80211_aliases[] =
     398static const struct ifmedia_description ifm_subtype_ieee80211_aliases[] =
    399399    IFM_SUBTYPE_IEEE80211_ALIASES;
    400400
    401 static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] =
     401static const struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] =
    402402    IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS;
    403403
    404 struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] =
     404static const struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] =
    405405    IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS;
    406406
    407 struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] =
     407static const struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] =
    408408    IFM_SUBTYPE_IEEE80211_MODE_ALIASES;
    409409
    410 static struct ifmedia_description ifm_subtype_atm_descriptions[] =
     410static const struct ifmedia_description ifm_subtype_atm_descriptions[] =
    411411    IFM_SUBTYPE_ATM_DESCRIPTIONS;
    412412
    413 static struct ifmedia_description ifm_subtype_atm_aliases[] =
     413static const struct ifmedia_description ifm_subtype_atm_aliases[] =
    414414    IFM_SUBTYPE_ATM_ALIASES;
    415415
    416 static struct ifmedia_description ifm_subtype_atm_option_descriptions[] =
     416static const struct ifmedia_description ifm_subtype_atm_option_descriptions[] =
    417417    IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS;
    418418
    419 static struct ifmedia_description ifm_subtype_shared_descriptions[] =
     419static const struct ifmedia_description ifm_subtype_shared_descriptions[] =
    420420    IFM_SUBTYPE_SHARED_DESCRIPTIONS;
    421421
    422 static struct ifmedia_description ifm_subtype_shared_aliases[] =
     422static const struct ifmedia_description ifm_subtype_shared_aliases[] =
    423423    IFM_SUBTYPE_SHARED_ALIASES;
    424424
    425 static struct ifmedia_description ifm_shared_option_descriptions[] =
     425static const struct ifmedia_description ifm_shared_option_descriptions[] =
    426426    IFM_SHARED_OPTION_DESCRIPTIONS;
    427427
    428428struct ifmedia_type_to_subtype {
    429429        struct {
    430                 struct ifmedia_description *desc;
     430                const struct ifmedia_description *desc;
    431431                int alias;
    432432        } subtypes[5];
    433433        struct {
    434                 struct ifmedia_description *desc;
     434                const struct ifmedia_description *desc;
    435435                int alias;
    436436        } options[3];
    437437        struct {
    438                 struct ifmedia_description *desc;
     438                const struct ifmedia_description *desc;
    439439                int alias;
    440440        } modes[3];
     
    442442
    443443/* must be in the same order as IFM_TYPE_DESCRIPTIONS */
    444 static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
     444static const struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
    445445        {
    446446                {
     
    535535get_media_subtype(int type, const char *val)
    536536{
    537         struct ifmedia_description *desc;
    538         struct ifmedia_type_to_subtype *ttos;
     537        const struct ifmedia_description *desc;
     538        const struct ifmedia_type_to_subtype *ttos;
    539539        int rval, i;
    540540
     
    559559get_media_mode(int type, const char *val)
    560560{
    561         struct ifmedia_description *desc;
    562         struct ifmedia_type_to_subtype *ttos;
     561        const struct ifmedia_description *desc;
     562        const struct ifmedia_type_to_subtype *ttos;
    563563        int rval, i;
    564564
     
    582582get_media_options(int type, const char *val)
    583583{
    584         struct ifmedia_description *desc;
    585         struct ifmedia_type_to_subtype *ttos;
     584        const struct ifmedia_description *desc;
     585        const struct ifmedia_type_to_subtype *ttos;
    586586        char *optlist, *optptr;
    587587        int option = 0, i, rval = 0;
     
    621621
    622622static int
    623 lookup_media_word(struct ifmedia_description *desc, const char *val)
     623lookup_media_word(const struct ifmedia_description *desc, const char *val)
    624624{
    625625
     
    631631}
    632632
    633 static struct ifmedia_description *get_toptype_desc(int ifmw)
    634 {
    635         struct ifmedia_description *desc;
     633static const struct ifmedia_description *get_toptype_desc(int ifmw)
     634{
     635        const struct ifmedia_description *desc;
    636636
    637637        for (desc = ifm_type_descriptions; desc->ifmt_string != NULL; desc++)
     
    642642}
    643643
    644 static struct ifmedia_type_to_subtype *get_toptype_ttos(int ifmw)
    645 {
    646         struct ifmedia_description *desc;
    647         struct ifmedia_type_to_subtype *ttos;
     644static const struct ifmedia_type_to_subtype *get_toptype_ttos(int ifmw)
     645{
     646        const struct ifmedia_description *desc;
     647        const struct ifmedia_type_to_subtype *ttos;
    648648
    649649        for (desc = ifm_type_descriptions, ttos = ifmedia_types_to_subtypes;
     
    655655}
    656656
    657 static struct ifmedia_description *get_subtype_desc(int ifmw,
    658     struct ifmedia_type_to_subtype *ttos)
     657static const struct ifmedia_description *get_subtype_desc(int ifmw,
     658    const struct ifmedia_type_to_subtype *ttos)
    659659{
    660660        int i;
    661         struct ifmedia_description *desc;
     661        const struct ifmedia_description *desc;
    662662
    663663        for (i = 0; ttos->subtypes[i].desc != NULL; i++) {
     
    674674}
    675675
    676 static struct ifmedia_description *get_mode_desc(int ifmw,
    677     struct ifmedia_type_to_subtype *ttos)
     676static const struct ifmedia_description *get_mode_desc(int ifmw,
     677    const struct ifmedia_type_to_subtype *ttos)
    678678{
    679679        int i;
    680         struct ifmedia_description *desc;
     680        const struct ifmedia_description *desc;
    681681
    682682        for (i = 0; ttos->modes[i].desc != NULL; i++) {
     
    696696print_media_word(int ifmw, int print_toptype)
    697697{
    698         struct ifmedia_description *desc;
    699         struct ifmedia_type_to_subtype *ttos;
     698        const struct ifmedia_description *desc;
     699        const struct ifmedia_type_to_subtype *ttos;
    700700        int seen_option = 0, i;
    701701
     
    756756print_media_word_ifconfig(int ifmw)
    757757{
    758         struct ifmedia_description *desc;
    759         struct ifmedia_type_to_subtype *ttos;
     758        const struct ifmedia_description *desc;
     759        const struct ifmedia_type_to_subtype *ttos;
    760760        int seen_option = 0, i;
    761761
Note: See TracChangeset for help on using the changeset viewer.