示例#1
0
        /// <summary>
        /// Маркировка пакетов
        /// </summary>
        /// <param name="secviceClass"></param>
        /// <returns></returns>
        public static int GetIPPrecedence(PHB secviceClass)
        {
            switch (secviceClass)
            {
            case PHB.DF:
                return(0);

            case PHB.AF1:
                return(1);

            case PHB.AF2:
                return(2);

            case PHB.AF3:
                return(3);

            case PHB.AF4:
                return(4);

            case PHB.EF:
                return(5);

            case PHB.CS6:
                return(6);

            case PHB.CS7:
                return(7);

            default:
                throw new Exception();
            }
        }
示例#2
0
        /// <summary>
        /// Маркировка пакетов на выходе
        /// </summary>
        /// <param name="secviceClass"></param>
        /// <param name="color"></param>
        /// <returns></returns>
        public static int getDSCP(PHB secviceClass, GradColor color)
        {
            switch (secviceClass)
            {
            case PHB.DF:
                return(0);

            case PHB.AF1:
                switch (color)
                {
                case GradColor.red:
                    return(14);

                case GradColor.yellow:
                    return(12);

                case GradColor.green:
                    return(10);

                default:
                    throw new Exception();
                }

            case PHB.AF2:
                switch (color)
                {
                case GradColor.red:
                    return(22);

                case GradColor.yellow:
                    return(20);

                case GradColor.green:
                    return(18);

                default:
                    throw new Exception();
                }

            case PHB.AF3:
                switch (color)
                {
                case GradColor.red:
                    return(30);

                case GradColor.yellow:
                    return(28);

                case GradColor.green:
                    return(26);

                default:
                    throw new Exception();
                }

            case PHB.AF4:
                switch (color)
                {
                case GradColor.red:
                    return(38);

                case GradColor.yellow:
                    return(36);

                case GradColor.green:
                    return(34);

                default:
                    throw new Exception();
                }

            case PHB.EF:
                return(46);

            case PHB.CS6:
                return(48);

            case PHB.CS7:
                return(56);

            default:
                throw new Exception();
            }
        }