• Oriol Arcas's avatar
    Added new footer.h header where BPF_LICENSE is set if not defined · 9aab22ec
    Oriol Arcas authored
    The helpers.h header specifies the BPF program license as 'GPL'.
    However, other GPL-compatible licenses are possible (e.g., Dual BSD/GPL)
    or even proprietary licenses (e.g., cachetop can run with a proprietary
    license).
    
    With this commit, the user can specify a BPF_LICENSE macro in the source
    code:
    
      #define BPF_LICENSE Custom license
    
    Note it supports multiple words and the absence of quotes. If the BPF
    doesn't have a GPL-compatible license and it uses any GPL-only helpers,
    the kernel will reject it with:
    
      cannot call GPL only function from proprietary program
    
    If no license is specified, it will fall back to GPL (the current
    behavior before this commit) so that the BCC tools and examples remain
    usable.
    
    Updated the documentation with BPF_LICENSE description, licensing error
    description, and licenses for each helper.
    Signed-off-by: default avatarOriol Arcas <oriol@starflownetworks.com>
    9aab22ec
loader.cc 14.3 KB