zoukankan      html  css  js  c++  java
  • [DPI][TCP] linux API的接口如何控制urgent包的收发

    做DPI,写协议栈的时候,处理到了urgent数据包。突然好奇应用层是如何控制发出urgent包的呢?而接收端又是如何知道,接受到了urgent包的呢?

    man 7 tcp,中有如下一段:

    TCP supports urgent data.  Urgent data is used to signal the receiver that some important message is part of the data stream and that it should be processed as soon as possible.
    To send urgent data specify the MSG_OOB option to send(2).  When urgent data is received, the kernel sends a SIGURG signal to the process or process group that has been  set  as
    the  socket  "owner" using the SIOCSPGRP or FIOSETOWN ioctls (or the POSIX.1-specified fcntl(2) F_SETOWN operation).  When the SO_OOBINLINE socket option is enabled, urgent data
    is put into the normal data stream (a program can test for its location using the SIOCATMARK ioctl described below), otherwise it can be received only when the MSG_OOB  flag  is
    set for recv(2) or recvmsg(2).
  • 相关阅读:
    类和迭代器
    使用委托调用函数
    自定义类和集合
    带函数的参数返回函数的最大值
    使用程序调试输出窗口
    自定义类
    类和结构
    全局参数
    带参数的函数返回数组之和
    IS运算符
  • 原文地址:https://www.cnblogs.com/hugetong/p/8398886.html
Copyright © 2011-2022 走看看